Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6773629
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:41:27+00:00 2026-05-26T15:41:27+00:00

I’d like to make my iPhone app to be able to switch between skins

  • 0

I’d like to make my iPhone app to be able to switch between skins (or design theme, or look and feel, such as wooden, metal, earth color, men’s, girls, etc…).

I’ll prepare some sets of skins that contains images for buttons and backgrounds, sounds, and text color, and let the user decide which set of skin they want to use by the application settings.

What is the best practice to implement this?

The conditions are:

  • I’d like to use Interface Builder
  • I need to support iOS 3.1.3 and later
  • I want to make the sets of skins downloadable from the internet (I can’t bundle all the skins in the app, as one set of skin requires lots of images and the app file size could become huge if I do so… I also don’t want to hardcode any information about specific skins.)
  • If a custom skin does not contain one or some elements, (such as an image or sound file), I want it to use the missing element from the default set of skin.
  • I don’t want to create Nib files for each skin. The Nib file for one screen should be the only one in the main bundle for easier maintenance.

I’m thinking about making a superclass of all the UIViewControllers in my app and override the part that it loads Nib file, and instead of loading from the main bundle, load the resources from the skin that is saved in the Document directory… but I don’t know how to do it… The default behavior of the Nib-loading methods always loads resources from the main bundle and the information about resource file names are lost after reading… 🙁

Thanks in advance for your help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T15:41:27+00:00Added an answer on May 26, 2026 at 3:41 pm

    Am not sure about best practice .. But, if your app is not big enough, then a well structured plist is your friend.

    Initially, you could choose: Metal Theme. The following should hold:

    You either have a Singleton ThemeManager, or just stick an NSDictionary to one of your Singletons if appropriate.

    The point behind the ThemeManager is the mapping between the asset and the theme..

    Some sample code (written directly on SOF .. Don’t mind Syntax mistakes):

    #define kThemeMap(__x__) [[ThemeManager sharedManager] assetForCurrentTheme:__x__]
    
    ...
    
    -(void)doUselessStuff {
        UIImage* backgroundImage = [UIImage imageNamed:kThemeMap(@"FirstViewBG")];
    
        ...
    
    }
    
    //in the ThemeManager:
    //returns the appropriate name of the asset based on current theme
    -(NSString*)assetForCurrentTheme:(NSString*)asset {
        //_currentTheme is an NSDictionary initialized from a plist. Plist can be downloaded, too.
        NSString* newAsset = [_currentTheme objectForKey:asset];
        if(newAsset == nil) {
            newAsset = [_defaultTheme objectForKey:asset];
        }
        return asset;
    }
    
    //Let us assume the user selects Metal Theme somewhere .. Still coding ThemeManager:
    -(void)selectedNewTheme:(NSString*)newTheme {
        //First, get the full path of the resource .. Either The main bundle, or documents directory or elsewhere..
        NSString* fullPath = ...;
        self.currentTheme = [NSDictionary dictionaryWithContentsOfFile:fullPath];
    }
    

    The plist files are just a dictionary with string to string mapping… something like this:

    //Default.plist
    @"FirstViewBG"  : @"FirstViewBG_Default.png"
    @"SecondViewBG" : @"SecondViewBG_Default.png"
    @"WinSound"     : @"WinSound_Default.aiff"
    
    //Metal.plist
    @"FirstViewBG"  : @"FirstViewBG_Metal.png"
    @"SecondViewBG" : @"SecondViewBG_Metal.png"
    @"WinSound"     : @"WinSound_Metal.aiff"
    

    Alternatively, you can just save the postfix, if that is good enough for you.. But, it will require string manipulation, by slicing the extension -> adding the postfix -> adding the extension ..

    Or maybe make it a prefix?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I've got a string that has curly quotes in it. I'd like to replace
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I am writing an app with both english and french support. The app requests
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
I am using Paperclip to handle profile photo uploads in my app. They upload
I have some data like this: 1 2 3 4 5 9 2 6

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.