Navigation item color behave like previous controller. How can I fix this?

45 Views Asked by At

I have a quick question about navigation item color behavior. For example my "A" controller's navigation item color is red. And "B" controller's navigation item color is default (blue). When I push from main controller to "A" controller and then go to "B" controller, this "B" controller's navigation item color displaying red. But it should be default color!!

I mean second controller behave like previous controller. Have you any idea about that ?

1

There are 1 best solutions below

6
Patrik Dendis On BEST ANSWER

Can you try set this code in your B Controller?

override func viewWillAppear(_ animated: Bool) {
    super.viewWillAppear(animated)
    navigationController?.navigationBar.tintColor = .systemBlue
}