I can suggest you a simpler way,
1. Just call [setNeedsStatusBarAppearanceUpdate][1] in viewDidLoad as Apple docs says,
> Call this method if the view controller's status bar attributes, such as hidden/unhidden status or style, change. If you call this method within an animation block, the changes are animated along with the rest of the animation block.
2. Implement [preferredStatusBarStyle][2] returning your preferred type.
It worked for me in iOS 10.1.
**Objective C**
[self setNeedsStatusBarAppearanceUpdate];
-(UIStatusBarStyle)preferredStatusBarStyle {
return UIStatusBarStyleLightContent;
}
**Swift**
setNeedsStatusBarAppearanceUpdate()
var preferredStatusBarStyle: UIStatusBarStyle {
return .lightContent
}
I am surprised nobody pointed this out. Anyway enjoy :)
[1]:
[To see links please register here]
[2]:
[To see links please register here]