In my iPad app I have an application settings view. One of the options lets the user switch interface color scheme. The settings view is loaded by segue to a separate view controller than my "main" app's window.
When they pick a new color I switch the colorSchemeColor variable and do this:
// set the colors and refresh the view
[[UINavigationBar appearance] setBarTintColor:colorSchemeColor];
[[UIToolbar appearance] setBarTintColor:colorSchemeColor];
[[UITabBar appearance] setBarTintColor:colorSchemeColor];
However, none of the bars change color until I exit my settings view! (When the settings window disappears, the colors for the "main" app change correctly!)
So then I tried to put this code right after to refresh the settings view:
[self.view setNeedsDisplay];
[self.view setNeedsLayout];
which didn't help. So I added this as well:
[self.navigationController.view setNeedsDisplay];
[self.navigationController.view setNeedsLayout];
This didn't work either.
How can I get my settings view to "redraw" itself when the new color is picked so the change is instantly obvious?
Thanks so much!