I'd like to override preferredStatusBarStyle
in an extension of UIViewController
like this:
extension UIViewController {
open override var preferredStatusBarStyle: UIStatusBarStyle {
return .lightContent
}
}
The compiler throws this error Getter for 'preferredStatusBarStyle' with Objective-C selector 'preferredStatusBarStyle' conflicts with method 'preferredStatusBarStyle()' with the same Objective-C selector
Applying the same override to UINavigationController
instead of UIViewController
works; but preferredStatusBarStyle is a var that is inherited by UIViewController.
-> Why is it possible to apply this extension to UINavigationController
but not to UIViewController