Setting the application icon badge number
suggest changeUse the following piece of code to set the badge number from within your application (suppose someNumber has been declared before). The app needs badge authorization, or the icon badge does not change. The Swift line is Swift 3.
Objective-C
[UIApplication sharedApplication].applicationIconBadgeNumber = someNumber;
Swift
UIApplication.shared.applicationIconBadgeNumber = someNumber
In order to remove the badge completely, just set someNumber = 0.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents