I have a UIViewController embedded in a UINavigationController. Inside my UIViewController I want to change the background color of the main UIWindow:
let appDelegate = UIApplication.sharedApplication().delegate as! AppDelegate
appDelegate.window!.backgroundColor = UIColor.blueColor()
The previous code work fine on iOS8 but in iOS7 there is no change in the background color of the UIWindow when it is embedded in a UINavigationController.
How can I change the background color of the UIWindow inside my UIViewController in iOS7?
If you are using a lot of popUp views and want to change background color of all the views at once just put this code in viewDidLoad of the root view. You can also modify it to change background color of a certain views.