Swift global:
extension UINavigationController{
open override func viewDidLoad() {
super.viewDidLoad()
if #available(iOS 13, *) {
self.navigationBar.standardAppearance = UINavigationBarAppearance()
self.navigationBar.standardAppearance.configureWithDefaultBackground()
self.navigationBar.standardAppearance.backgroundColor = mainColor
self.navigationBar.standardAppearance.titleTextAttributes = [NSAttributedString.Key.foregroundColor: UIColor.white]
}
else {
self.navigationBar.titleTextAttributes = [NSAttributedString.Key.foregroundColor: UIColor.white]
self.navigationBar.barTintColor = mainColor
}
}
}
Topic:
Developer Tools & Services
SubTopic:
General
Tags: