Search code examples
iosobjective-cswiftstatusbar

Status Bar Style changes from light to black when resuming from multitask


If I double tap the home button to bring up all the apps that are loaded on my phone and then select my app, the status bar style will be black for a second and then switch to white again.


Solution

  • In the info.plist file of your app make sure to add this Status bar stytle and View controller-basedStatus bar appearance

    info.plist file configuration

    I found adding this also helps for the view in question.

    func navigationController(navigationController: UINavigationController, willShowViewController viewController: UIViewController, animated: Bool) {
            // for some reason, they thought it would be fun to switch the status bar color when this is presented, so we'll change it back.... -.-
        UIApplication.sharedApplication().statusBarStyle = .LightContent
    }