Skip to content

Instantly share code, notes, and snippets.

@jazzedge
Last active November 29, 2017 17:37
Show Gist options
  • Select an option

  • Save jazzedge/80e1bd4dbf7e6f25ca362fc931171fc1 to your computer and use it in GitHub Desktop.

Select an option

Save jazzedge/80e1bd4dbf7e6f25ca362fc931171fc1 to your computer and use it in GitHub Desktop.
How to set statusBarStyle and UINavigationBar for all VCs
//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