I am trying to hide status bar in one of my UIViewControllers (Swift 4).
Firstly, I set View controller-based status bar appearance to
I discovered that prefersStatusBarHidden
wasn't being called in my view controller because I was using a custom container view and I needed to forward the status bar hiding responsibility to the child view controller. Implementing var childForStatusBarHidden: UIViewController? { return childViewController }
in the container view controller fixed if for me.