UIApplication.sharedApplication().setStatusBarStyle() deprecated in iOS 9 UIApplication.sharedApplication().setStatusBarStyle() deprecated in iOS 9 xcode xcode

UIApplication.sharedApplication().setStatusBarStyle() deprecated in iOS 9


I think I have found a solution.I ended up setting the

View controller-based status bar appearance boolean to NO

In my info.plist file.

Info.Plist

Then I went to my target's General settings -> Deployment info and changed the dropdown optionStatus Bar Style to Light instead of Default

Change Status Bar Style to Light

This changed the statusbar style to Light for my whole application, just what I wanted.

I Hope this helps!


In swift 3.

In your view controller:

override var preferredStatusBarStyle: UIStatusBarStyle {    return UIStatusBarStyle.lightContent}

If you wish when the app run your launch screen also has the status bar in lightContent then:

enter image description here


In Swift 3 is like that:

 UIApplication.shared.statusBarStyle = .lightContent