Question

Which is the best way to implement on Cocoa Touch the unread counts on a icon on a TabBar?

I want to mimic the SMS or Mail application behavior, showing the unread message count to the user of my application, with a red dot containing a number.

Was it helpful?

Solution

The property you're looking for is called the badge. You set it by doing something like:

self.tabBarItem.badgeValue = @"1";

OTHER TIPS

Have you looked at: setApplicationBadgeNumber?

[[UIApplication sharedApplication] setApplicationBadgeNumber:int];

For current view I use:

self.navigationController.tabBarItem.badgeValue = @"5";
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top