I am facing the navigation title color not change when I pop controller. Please find the below code.
ProfilescreenVC.swift
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
self.navigationController?.navigationBar.tintColor = UIColor.white
self.navigationController?.navigationBar.barTintColor = UIColor.primaryGreen
let textAttributes = [NSAttributedStringKey.foregroundColor:UIColor.white]
self.navigationController?.navigationBar.titleTextAttributes = textAttributes
}
EditprofileVC.swift
override func viewDidLoad() {
super.viewDidLoad()
self.style()
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
func style() {
navigationController?.navigationBar.tintColor = UIColor.black
navigationController?.navigationBar.barTintColor = UIColor.white
let textAttributes = [NSAttributedStringKey.foregroundColor:UIColor.black]
navigationController?.navigationBar.titleTextAttributes = textAttributes
carbonTabSwipeNavigation.setIndicatorColor(UIColor.black)
carbonTabSwipeNavigation.setTabBarHeight(50.0)
carbonTabSwipeNavigation.setNormalColor(UIColor.hexString("9A9CA1"), font: UIFont.systemFont(ofSize: 15))
carbonTabSwipeNavigation.setSelectedColor(UIColor.black, font: UIFont.systemFont(ofSize: 15))
self.navigationController?.view.setNeedsLayout()
self.navigationController?.view.layoutIfNeeded()
}
override func viewDidDisappear(_ animated: Bool) {
navigationController?.navigationBar.tintColor = UIColor.white
navigationController?.navigationBar.barTintColor = UIColor.white
let textAttributes = [NSAttributedStringKey.foregroundColor:UIColor.white]
navigationController?.navigationBar.titleTextAttributes = textAttributes
super.viewDidDisappear(animated)
}
I have a facing issue with the color changing of the title please check the following video for better understanding.