What is the purpose of the title
property of UIViewController, can't the title already be set with navigationItem.title
?
Both seem to work, I'm just wondering why there's this seemingly duplicated functionality.
In a UIViewController, title and navigationItem.title are different. One example: if you have a view controller (in a NavigationController) in a UITabBarController, then if you set self.title it overrides the name of the tab as well as the top title. If you set self.navigationItem.title then it only changes the top title, leaving the tab bar name unchanged.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With