Maxim Tsybanov Maxim Tsybanov - 4 months ago 15
Swift Question

Color text of status bar in XCode 6-b3 (Swift)

I've try to modify status bar color text but no one answer from this thread doesn't work.
Any especially for XCode 6?

I've tried insert:

override func preferredStatusBarStyle() -> UIStatusBarStyle {
return UIStatusBarStyle.LightContent
}


to
UIViewController


also

UIApplication.sharedApplication().setStatusBarStyle(UIStatusBarStyle.LightContent, animated: true)


to
AppDelegate.swift

And I've tried change it in
info.plist

But it doesn't affect it. How change status bar color text to white?

Answer

In your Info.plist you need to define View controller-based status bar appearance to any value.

enter image description here

If you define it YES then you should override preferredStatusBarStyle function in each view controller.

If you define it NO then you can set style in AppDelegate using

UIApplication.sharedApplication().statusBarStyle = .LightContent

Comments