Here's my implementation in a subclass of UIViewController
:
override func viewWillAppear(animated: Bool) {
super.viewWillAppear(animated)
UIApplication.sharedApplication().setStatusBarStyle(UIStatusBarStyle.LightContent, animated: false)
}
I tried putting it in AppDelegate initialisation code (using the passed in UIApplication instance), however the status bar is still black..
Is this a bug with iOS 8 or am I doing it wrong?
Note: I may be breaking someone's law's here by discussing ios 8.. Its a general problem that, when compiled doesn't work for ios 7 either.
Update: Still doesn't work, even with value in Info.plist and code in - didFinishLaunchingWithOptions
You really should implement preferredStatusBarStyle
on your view controller(s):
override func preferredStatusBarStyle() -> UIStatusBarStyle {
return .LightContent
}
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject:AnyObject]?) -> Bool {
application.setStatusBarStyle(UIStatusBarStyle.LightContent, animated: false)
return true
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With