I am trying to hide status bar in one of my UIViewControllers (Swift 4).
Firstly, I set View controller-based status bar appearance to YES in
Info.plist.I overrode the
prefersStatusBarHiddenproperty in my controller:
override var prefersStatusBarHidden: Bool {
return true
}
- And in
viewDidLoad(), I addedsetNeedsStatusBarAppearanceUpdate()function to force theprefersStatusBarHiddenproperty to be read.
After all that, I still see the status bar on that UIViewController.
Can someone help me, please?


]