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;
To remove the icon, set the property to 0.
Apple Developer Website Documentation
source
share