Edward An
Edward An

Reputation: 1737

iPhone icon - Red # indicators

How do you implement the red number indicators (like the email count notification)?

Upvotes: 3

Views: 1404

Answers (2)

Chris McCall
Chris McCall

Reputation: 10407

What you want is called a "badge".

[UIApplication sharedApplication].applicationIconBadgeNumber = 2;

EDIT: removed SetApplicationBadge

Upvotes: 0

Luke Redpath
Luke Redpath

Reputation: 10565

What you are looking for is the applicationIconBadgeNumber property which is a property of UIApplication.

To set the badge, from anywhere in your app, use:

UIApplication *application = [UIApplication sharedApplication];
application.applicationIconBadgeNumber = 1; // set to any integer

To remove the badge, set the property to 0.

Documentation on Apple Developer Website

Upvotes: 12

Related Questions