How do I change the color of the status bar in an iPhone app?

Solutions Collect From Internet About “How do I change the color of the status bar in an iPhone app?”

To change the navigation bar color:

navigationController!.navigationBar.barTintColor = UIColor.blueColor()

To change the text in the navigation bar:

navigationController!.navigationBar.titleTextAttributes = [NSForegroundColorAttributeName: UIColor.yellowColor()]

Update
To change the status bar:

  1. Go to your info.plist and add the following key View controller-based status bar appearance and set the value to NO
  2. In you viewControllers viewDidload do set

White bar:
UIApplication.sharedApplication().statusBarStyle = .LightContent

Dark bar:
UIApplication.sharedApplication().statusBarStyle = .Default