I need to update status bar style on every view controller based on the background color (what UINavigationController
is doing automatically).
Have trie
Set View controller-based status bar appearance
to NO
in the info.plist
and override preferredStatusBarStyle
in each view controller like so:
override var preferredStatusBarStyle: UIStatusBarStyle {
return .lightContent
}
And call setNeedsStatusBarAppearanceUpdate()
in your view controller (in viewDidLoad()
for example).