"UIApplication.shared.applicationIconBadgeNumber" deprecated, how to get the "badge icon number" in iOS 17?

Hi, The UIApplication.shared.applicationIconBadgeNumber has been deprecated in iOS 17 and the recommendation is to use setBadgeCount(_:withCompletionHandler:) but what if I only want to read this number and not change it? How would one only read this number in iOS 17?

You should maintain your own internal state value for it instead of trying to read it back from the system.

"UIApplication.shared.applicationIconBadgeNumber" deprecated, how to get the "badge icon number" in iOS 17?
 
 
Q