IPhone Icon - Red Indicators #

How do you implement red number indicators (e.g. notification of the number of email messages)?

+3
source share
2 answers

What you are looking for is a property applicationIconBadgeNumberthat is a property UIApplication.

To install the icon from anywhere in your application, use:

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

To remove the icon, set the property to 0.

Apple Developer Website Documentation

+12
source

What you want is called an "icon."

[UIApplication sharedApplication].applicationIconBadgeNumber = 2;

EDIT: deleted SetApplicationBadge

0
source

Source: https://habr.com/ru/post/1714314/


All Articles