FS.O6 FS.O6 - 7 months ago 57
Swift Question

Adding white status bar

I'm trying to add a white status bar to my ViewController like that:

override var preferredStatusBarStyle: UIStatusBarStyle {
return .lightContent

but it doesn't work in most of the views (it worked on some)

Any idea how to make it work?



Subclass UINavigationController as below. Then in interface builder set the class of your navigation controller to "MyNavigationController.

class MyNavigationController: UINavigationController {
  override func preferredStatusBarStyle() -> UIStatusBarStyle {
  return .LightContent