I am trying to hide status bar in one of my UIViewControllers (Swift 4).
Firstly, I set View controller-based status bar appearance to
None of these worked for me either working on a converted project in iOS 11. Here's what I did. I added this code in the AppDelegate
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool
{
application.isIdleTimerDisabled = true
application.isStatusBarHidden = true
return true
}