I'm looking to theme my iOS app and have been reading up on UIAppearance. I want the user to be able to switch between a number of different visual themes from within the app. Changing a theme would then be shown in the UI.
I'm thinking I could have a theme file that is a singleton loaded within the appDelegate.m. But after that i'm a little stuck on how this could be implemented?
The solution suggested by Robert, doesn't work for me . I'm using iOS9 and UITabbarController . This suggestion is the only that worked from answer here
It basically explained the problem well, when we use UIAppearance, it basically is applied and will not change until the views is redrawn again which will not happen especially with rootViewController like UITabbarControllers and new colors will only have effect ONLY AFTER the App is removed from memory and opened again, if you want an immediate change , you will have to make it by hand and setting each property like described in the answer in attached link
This works for me in Swift:
swift 4:
UIKit sets properties from UIAppearance proxy after view is added to views hierarchy.
In UISS I use method like this:
Another trick is to remove rootViewController from main window and add it again. Though I prefer the first solution, because it covers wider range of cases.