Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

RagingGoat

macrumors 6502
Original poster
Jun 21, 2010
308
15
The home screen of my app has several buttons. I'm wondering if there is a way to add a badge for push notifications to one of those buttons.
 
There's no built-in way to draw a badge. The only built-in badge support that I know of is to add a badge to your app's icon on the springboard (maybe something also for tabs in a tab controller). There's a certain amount of source code floating around to do that so look for it.
 
The home screen of my app has several buttons. I'm wondering if there is a way to add a badge for push notifications to one of those buttons.

It would be pretty easy to create a custom subclass of UIButton that has the option to display a badge. Then the view controller that manages the button could set the button's badge value as needed.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.