For ViewController containment

suggest change

If you are using UIViewControllerContainment there are a few other methods that are worth looking at.

When you want a child viewController to control the presentation of the status bar (i.e. if the child is positioned at the top of the screen

in Swift

class RootViewController: UIViewController {

    private let messageBarViewController = MessageBarViewController()        

    override func childViewControllerForStatusBarStyle() -> UIViewController? {
        return messageBarViewController
    }

    override func viewDidLoad() {
        super.viewDidLoad()
        
        //add child vc code here...

        setNeedsStatusBarAppearanceUpdate()
    }
}

class MessageBarViewController: UIViewController {
    
    override func preferredStatusBarStyle() -> UIStatusBarStyle {
        return .Default 
    }
}

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents