I am setting the title field of a UIViewController
via Interface Builder/Storyboard:
You can set the title of the UINavigationBar
in Storyboard by double clicking the actual navigationBar and typing in a title right there. This only sets the title for the UINavigationBar
.
Setting the title in code offers some different possibilities.
self.title = @"Your title";
will set the title of a navigationBar and also cause the title to cascade down to a UITabBarItem, if present.
self.navigationItem.title = @"Your title";
will only set the title of the navigationBar, assuming a UINavigationController is present, and NOT affect a UITabBarItem.
self.navigationController.title = @"Your title";
will set the title of a UITabBarItem but NOT the UINavigationBar.