I have two different view controllers added to the view controllers array of a TabBarController and this TabBarController is added to a Navigation Controller.
Now I want to show different title for different views in the tabbar, on the navigationController.
Any help would be appreciated.
the title within the navigation bar is taken from the navigation item from it’s top view controller. It sounds like its top view controller, in your case, is the tab bar controller, so you’ll want to set the title of the tab bar controller whenever the tab bar changes.
Specifically, you’ll want to assign a
UITabBarControllerDelegateto the tab bar controller’sdelegateproperty and implement the following method:The line is equivalent to
So you can use either one. Any way, set the titles of the individual tab view controllers to whatever title you want, and then the title will change when the tabs change.