Try adding the following method to your VC. Use .default or .lightContent to change the color of the status bar. I tested with Xcode 8 and quick 3:
override func preferredStatusBarStyle() -> UIStatusBarStyle { return UIStatusBarStyle.default; }
I created a new tabbed application with Xcode 7.3.1 and swift 2.3. I have two tabs with classes related to FirstViewController and SecondViewController. In FirstViewController, I added the following method:
override func preferredStatusBarStyle() -> UIStatusBarStyle { return UIStatusBarStyle.default; }
And in SecondViewController, I changed the background to black, and I added the following method:
override func preferredStatusBarStyle() -> UIStatusBarStyle { return UIStatusBarStyle.LightContent; }
Finally, I added two buttons to the FirstViewController. One button represents the controller modulo, and the other button is present via push. When I presented the view in the format "preferredStatusBarStyle", but when I presented via push, I need to add the following line of code:
self.navigationController?.navigationBar.barStyle = .Black
source share