I need to create an application that should have several themes. It means that for each theme we use different set of images. The theme should be changed without full reload of all view controllers (just change the images). The themes could be added via In app purchases so they should not be hardcoded.
I also want to use Interface Builder to create my views.
Question: what is the best way to do that?
On MyAppNotificationUIThemeChanged every controller has to retrieve and set images for every UIImageView in it’s main view. I can think of 2 approaches for doing this:
1) Brute force. Something like this:
2) Automated approach.
where currentThemeImageForTag: is something like this:
I also suggest to use NSBundle to package theme images and other resources.
Update:
I chose NSBundle only because of it’s cool methods like pathForResource:ofType: and such and also ability to support localization. You can create bundle with XCode (just look under Mac OS X -> Framework&Library section in new project dialog). Put your images in Resources, remove liks to any frameworks (there is no code anyway), build and that’s it. In your app load bundle with
[NSBundle bundleWithPath:pathToDownloadedBundle]. Beware though: I don’t know if Apple allows to download bundles and use it’s content in app. All I can guarantee is that it works on simulator.