0
votes

I use UITabBarController for iOS app. it has 3 tabs. For example tab1 (current tab), tab2 and tab3. I want put a small red badge on tab3 icon when click a button on tab1. Is there any way to add it?

1
Consider getting in the habit of familiarizing yourself with the iOS documentation. It is a fun read sometimes and can really help you out quickly.Carl Veazey

1 Answers

1
votes

UITabBarItems have a badgeValue property. You can set this when your delegate method gets fired.

- (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item; 

You can get the TabBarItem #3 from the tabBarController with

[tabBarController.tabBar.items objectAtIndex:2];