How do you hide the status bar in ios 9?
This is now deprecated:
[UIApplication sharedApplication] setStatusBarHidden:YES];
If for some reason you need View controller-based status bar appearance equal to YES (for example to keep status bar white)
on AppDelegate's didFinishLaunchingWithOptions method or wherever you setup your navigationController:
yourNavigationController.navigationBar.barStyle = .black
then use alex-staravoitau's awesome answer and add this code wherever you'll be hiding the status bar:
override var preferredStatusBarStyle: UIStatusBarStyle {
return .lightContent
}
I'm not sure if this is the right way to achieve this result, but it worked for me and I hope it helps someone else too :)