Badging Applications

If you’ve used iOS for any time, you’ve likely seen the small red badges that appear over applications on the home screen. These might indicate the number of missed phone calls or unread e-mails that have accumulated since the user last opened Phone or Mail.

To set an application badge from within a program, set the applicationIconBadgeNumber property to a positive integer. To hide badges, set applicationIconBadgeNumber to 0.

Remove your badges predictably, such as on opening the application. Users expect that opening an application will clear the badge on the SpringBoard.

Get The Core iOS Developer’s Cookbook, Fifth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.