0

I need to make use of preferredStatusBarStyle for view controllers in a navigation controller. When I extend like so:

@objc
extension UINavigationController {

open override var childForStatusBarStyle: UIViewController? {
    topViewController
}

}

The app doesn't seem to ever touch childForStatusBarStyle

but when I subclass it like so:

import UIKit

class CustomNavigationViewController: UINavigationController {

override var childForStatusBarStyle: UIViewController? {
    topViewController
}

}

The app uses childForStatusBarStyle. Why is this?

visandres
  • 47
  • 6

0 Answers0