The iOS 10.0 API Diffs shows that the UIViewController.preferredStatusBarStyle() -> UIStatusBarStyle
method has been removed and that the UIViewController.preferredStatusBarStyle
property has been added.
In a similar way, with Xcode 8, you can right-click on any UIViewController
in your code, select Jump to Definition and then perform a search for preferredStatusBarStyle
. You will discover that preferredStatusBarStyle
now has the following declaration:
@available(iOS 7.0, *)
open var preferredStatusBarStyle: UIStatusBarStyle { get }
Therefore, the following code snippet shows how to override preferredStatusBarStyle
with Xcode 8 / Swift 3:
override var preferredStatusBarStyle: UIStatusBarStyle {
get {
return .lightContent
}
}
Or, in a much shorter and preferred style:
override var preferredStatusBarStyle: UIStatusBarStyle {
return .lightContent
}
Swift 3
changes do make sense. – Restitution