I'm updating an iOS app for iOS 12 and ran into this warning.
I'm changing the status bar in the AppDelegate.swift file for my app. This can be found in the didFinishLaunchingWithOptions function
UIApplication.shared.statusBarStyle = UIStatusBarStyle.lightContent
I'm getting a warning that says this:
Setter for 'statusBarStyle' was deprecated in iOS 9.0: Use -[UIViewController preferredStatusBarStyle]
I thought this would be an easy update, but I haven't found an update that has worked for me.
I tried setting this on the main VC:
// set the status bar color
override var preferredStatusBarStyle : UIStatusBarStyle {
return .lightContent
}
But it's not displaying in light mode.
When I try and type the override out myself, this is what I get for code hinting.