Hide statusbar during splash screen

This is updated for Swift 3 of Xcode 8.3.3

In your Info.plist add the following key:

info.plist

Then in your AppDelegate file add the following in didFinishLaunchingWithOptions section:

func application(_application:UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 
      UIApplication.shared.isStatusBarHidden = false
      return true 
}

That should sort out your problem.

You can also configure the launch colour in your project Build Settings if this is a problem for you:

buildOptions

Hope that helps!


In Swift 4 In Info.plist add:

Status bar is initially hidden YES


Just add the highlighted line into your Info.plist file and it'll work for Swift 4:

enter image description here


In your Project Settings -> General-> Deployment Info, check "Hide status bar" field.

enter image description here

Next in your view controller override - prefersStatusBarHidden method, like this:

override func prefersStatusBarHidden() -> Bool {
   return false
}

Tags:

Ios

Swift