iOS13 - problem with navigationBar title color
func manageNavigationBar(){
if #available(iOS 13.0, *){
let navBarAppearance = UINavigationBarAppearance()
navBarAppearance.configureWithOpaqueBackground()
navBarAppearance.backgroundColor = UIColor(red: 0.6157, green: 0.3412, blue: 0.8588, alpha: 1.0)
navBarAppearance.titleTextAttributes = [.foregroundColor: UIColor.white]
navBarAppearance.largeTitleTextAttributes = [.foregroundColor: UIColor.white]
UINavigationBar.appearance(whenContainedInInstancesOf: [UINavigationController.self]).standardAppearance = navBarAppearance
UINavigationBar.appearance(whenContainedInInstancesOf: [UINavigationController.self]).scrollEdgeAppearance = navBarAppearance
}
}
//call this function in your AppDelegate also in a class where you want navigation to work like this
In iOS 13, I change the title color like this
UINavigationBarAppearance *appearance = [self.navigationController.navigationBar standardAppearance];
appearance.titleTextAttributes = @{NSForegroundColorAttributeName: [UIColor whiteColor]};
self.navigationController.navigationBar.standardAppearance = appearance;
self.navigationController.navigationBar.scrollEdgeAppearance = appearance;