0
votes

In previous versions of Swift, to change the status bar style I would use 'preferredStatusBarStyle' and return .lightContent.

This method is now unavailable, I have tried every solution on SO such as:

    self.navigationController?.navigationBar.barStyle = UIBarStyle.black
    self.navigationController?.isNavigationBarHidden = true

However, these techniques do not work. Can someone please shed some light on this. Currently in my plist, I have 'statusBarStyle' set to 'UIStatusBarStyleLightContent'.

You're welcome to download my project here: https://github.com/benskill/Flash-Flags

1

1 Answers

1
votes

In iOS 10, preferredStatusBarStyle is a property, not a method. So instead of overriding it with a func declaration, you override the getter with a var declaration.

override var preferredStatusBarStyle: UIStatusBarStyle {
   return .lightContent
}