Search code examples
iosswiftappdelegateuistatusbar

Swift: Can't set StatusBarStyleLightContent


This is really weird, I have page view controller with onboarding flow and I cannot set the white color in status bar.

I added "Status bar style" with "UIStatusBarStyleLightContent" value in info.plist along with appropriate line in AppDelegate

UIApplication.sharedApplication().statusBarStyle = UIStatusBarStyle.LightContent

Despite making these two steps I keep getting black status bar.

Maybe this is something with Xcode 6.3? Did any of you encounter such a weird issue? If yes, how to fix that?

Thanks in advance!


Solution

  • Just added these four lines into my Info.plist

    <key>UIViewControllerBasedStatusBarAppearance</key>
    <false/>
    <key>UIStatusBarStyle</key>
    <string>UIStatusBarStyleLightContent</string>
    

    After that I didn't even needed to set anything from code.