How to change the color of the Back button in UINavigationBar?
Hello everyone! I'm new to iOS development and can't figure out how to customize the navigation bar. I have an app with UINavigationController, and the default Back button is displayed in blue. I need to change its color to white because the navigation bar background is dark.
I tried changing the tintColor of the navigationBar, but it changes the color of all elements (title, right buttons), and I only need the Back button. Here's my code:
```swift
override func viewDidLoad() {
super.viewDidLoad()
navigationController?.navigationBar.tintColor = .white // Changes everything
}
```
I also read about UIBarButtonItem and backBarButtonItem, but I didn't understand how to apply this specifically to the color. Maybe there is a way through appearance? Please advise how to correctly change the color of the Back button only.
No answers yet.
Log in to leave an answer