When I change controller's self.title
, tab title also changes to that string.
Is it any workaround to avoid it?
When I change controller's self.title
, tab title also changes to that string.
Is it any workaround to avoid it?
From the documentation of UITabBarController
:
If you do not provide a custom tab bar item for your view controller, the view controller creates a default item containing no image and the text from the view controller’s title property.
So you can either instantiate your own UITabBarItem
and assign it to the view controller’s tabBarItem
property.
Or simply just add a new property to your UIViewController
that can store the string:
@property (nonatomic, copy) NSString *myTitle;
And then use that property instead:
self.myTitle = @"Your title here";