Is there a built in badge icon like the info icon so that I can show status updates on other views in my app? It's easy enough to duplicate manually but I'd like to use a built in resource if it's available.
Check out CustomBadge, the site is in German, but theres sample source code there.
You can also steal a badge from a tabbar view like this:
IBOutlet UITabBarItem *tabbarItem;
UIView *badgeView;
badgeView = [[UIView alloc] initWithFrame:CGRectMake(25,100, 32, 32)];
badgeView.backgroundColor = [UIColor clearColor];
badgeView.clipsToBounds = NO;
[badgeView addSubview:[((UIView *)[tabbar.subviews objectAtIndex:0]).subviews objectAtIndex:0]];
and to set the value for that badge:
tabbarItem.badgeValue = unreadCount;
Note that you don't have to use a UITabbar thats visible in your app, you are simple stealing the badge resource.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With