4thSpace 4thSpace - 1 year ago 323
Swift Question

How to change back button color in nav bar?

Is there a way to change only the left side back button color in an app with a navigation controller?

There are plenty of examples changing colors in the navbar but those all affect the navbar title as well. I don't want to change the title. Just the back button (text + chevron) color.

Answer Source

Use Below To Change Back Button Color:

self.navigationController?.navigationBar.tintColor = UIColor.redColor()

To Change Title Color of The Navigation Bar Use:

self.navigationController?.navigationBar.titleTextAttributes = [NSForegroundColorAttributeName: UIColor.redColor()]