Quote:
Originally Posted by mtbsrams
What is the best method or design for building an application with multiple UI themes?
|
There are various ways to do this. Here's one:
A view controller can decide what XIB file to load at run-time. The standard Apple template for universal apps does this based on the type of device that's running.
You could include multiple versions of all your app's XIB files, named using extensions that specify a theme (e.g. "mainViewController_chrome.xib", "mainViewController_walnut.xib", "mainViewController_leather.xib").
Write a front end that lets the user pick a theme, or "skin". Use the user's choice to set a global theme string. Save that theme string into user defaults.
When each view controller is invoked, have it build the name for it's XIB file using the theme string.
Note that because of Apple's restrictions, neither you nor your users would not be able to add skins to your app. You'd have to update the app in order to add new skins.
If you wanted to sell extra skins using in-app purchase, what you would have to do is include all the skins in the app, with the extra-cost skins turned off. When the user purchased a new skin, it would just save a cookie in user defaults that unlocked that skin.