title: How do I hide the status bar in a Swift iOS app?
body: <p>I'd like to remove the status bar at the top of the screen.</p>
  
  <p>This does not work:</p>
  
  <pre><code>func application
  (application: UIApplication,
  didFinishLaunchingWithOptions launchOptions: NSDictionary?)
  -&gt; Bool
  {
          application.statusBarHidden = true
          return true
  }
  </code></pre>
  
  <p>I've also tried:</p>
  
  <pre><code>func application
  (application: UIApplication,
  didFinishLaunchingWithOptions launchOptions: NSDictionary?)
  -&gt; Bool
  {
      self.window = UIWindow(frame: UIScreen.mainScreen().bounds)
  
      var controller = UIViewController()
      application.statusBarHidden = true
      controller.setNeedsStatusBarAppearanceUpdate()
  
      var view = UIView(frame: CGRectMake(0, 0, 320, 568))
      view.backgroundColor = UIColor.redColor()
      controller.view = view
  
      var label = UILabel(frame: CGRectMake(0, 0, 200, 21))
      label.center = CGPointMake(160, 284)
      label.textAlignment = NSTextAlignment.Center
      label.text = "Hello World"
      controller.view.addSubview(label)
  
      self.window!.rootViewController = controller
      self.window!.makeKeyAndVisible()
      return true
  }
  </code></pre>