SwiftTry
SwiftTry

Reputation: 151

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

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 ?

Upvotes: 1

Views: 45

Answers (1)

Patrik Dendis
Patrik Dendis

Reputation: 313

Can you try set this code in your B Controller?

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

Upvotes: 1

Related Questions