Last active
November 29, 2017 17:37
-
-
Save jazzedge/80e1bd4dbf7e6f25ca362fc931171fc1 to your computer and use it in GitHub Desktop.
How to set statusBarStyle and UINavigationBar for all VCs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //See: https://stackoverflow.com/questions/43073623/changing-the-color-of-the-status-bar | |
| Source: BorgGreen | |
| 01. First in Plist set View controller-based status bar appearance to NO | |
| 02. Add this code to AppDelegate.swift | |
| func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { | |
| // Set Status Bar to light colour for ALL ViewControllers | |
| //UIApplication.shared.statusBarStyle = .lightContent | |
| //Set Navigation Bar text to black for ALL ViewControllers | |
| UINavigationBar.appearance().backgroundColor = UIColor.red | |
| UINavigationBar.appearance().tintColor = UIColor.black | |
| return true | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment