I have a navigation bar with a title. When I double click the text to rename it, it actually says it\'s a navigation item, so it might be that.
I\'m trying to change
I prefer using self.navigationItem.title = "Your Title Here"
over self.title = "Your Title Here"
to provide title in the navigation bar since tab bar also uses self.title
to alter its title. You should try the following code once.
Note: calling the super view lifecycle is necessary before you do any stuffs.
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
setupNavBar()
}
}
private func setupNavBar() {
self.navigationItem.title = "Your Title Here"
}