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?
Try this