It's not working because in Info.plist
you have specified <key>UIViewControllerBasedStatusBarAppearance</key><false/>
. Change it that key to true
, and it'll work. Main idea behind that key is, when it's true, application looks in your view controllers code for the status bar style for the implementation of preferredStatusBarStyle
(for status bar style) and prefersStatusBarHidden
(for if it should hide status bar for this view controller). And, when the UIViewControllerBasedStatusBarAppearance
key is false, application looks for the global settings defined in General
section of the target preferences (choose project file in project navigator in xcode).
Also, you have to keep in mind that, when your view controller is on containers like UINavigationController
or UITabbarController
, in order to change the status bar appearance, you have to extends those containers (write extension), and override preferredStatusBarStyle
property.
You can check this answer on SO as well.