Tutorial by Examples

In info.plist set View controller-based status bar appearance to YES In view controllers not contained by UINavigationController implement this method. In Objective-C: - (UIStatusBarStyle)preferredStatusBarStyle { return UIStatusBarStyleLightContent; } In Swift: override func pre...
Subclass UINavigationController and then override these methods: In Objective-C: - (UIStatusBarStyle)preferredStatusBarStyle { return UIStatusBarStyleLightContent; } In Swift: override func preferredStatusBarStyle() -> UIStatusBarStyle { return .lightContent } Alternativel...
If you are using library that contains (for example) AwesomeViewController with a wrong status bar color you can try this: let awesomeViewController = AwesomeViewController() awesomeViewController.navigationBar.barStyle = .blackTranslucent // or other style
If you are using UIViewControllerContainment there are a few other methods that are worth looking at. When you want a child viewController to control the presentation of the status bar (i.e. if the child is positioned at the top of the screen in Swift class RootViewController: UIViewController { ...
SWIFT: Step 1: In your Info.plist add the following attribute: View controller-based status bar appearance and set its value to NO as described in the image below: Step 2: In your AppDelegate.swift file, in didFinishLaunchingWithOptions method, add this code: UIApplication.shared.st...

Page 1 of 1