Skip to content

Instantly share code, notes, and snippets.

@MickhailP
Created March 5, 2023 10:16
Show Gist options
  • Save MickhailP/c2362b66f7b7a9d9e8090fe4562d6e7b to your computer and use it in GitHub Desktop.
Save MickhailP/c2362b66f7b7a9d9e8090fe4562d6e7b to your computer and use it in GitHub Desktop.
ChangeNavBarAppearance
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
if let navController = window!.rootViewController as? UINavigationController {
navController.delegate = self
let appearance2 = UINavigationBarAppearance()
appearance2.backgroundColor = .systemBlue
appearance2.titleTextAttributes = [.foregroundColor: UIColor.white]
appearance2.largeTitleTextAttributes = [.foregroundColor: UIColor.white]
navController.navigationBar.standardAppearance = appearance2
navController.navigationBar.compactAppearance = appearance2
navController.navigationBar.scrollEdgeAppearance = appearance2
navController.navigationBar.tintColor = .white
}
return true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment