Skip to content

Instantly share code, notes, and snippets.

View kenmaready's full-sized avatar

ken kenmaready

View GitHub Profile
kenmaready / gist:c61a801b677eede59f28029c8fe3f68d
Last active July 30, 2022 13:06
Change color of nav bar and status bar inside viewDidLoad in iOS Apps
// inside viewDidLoad() or wherever you set appearance of your navigation bar:
let appearance = UINavigationBarAppearance()
appearance.backgroundColor = UIColor.systemBlue
appearance.titleTextAttributes = [.foregroundColor: UIColor.white]
navigationItem.standardAppearance = appearance
navigationItem.scrollEdgeAppearance = appearance