How to set tab badge from app delegate
I'm trying to set the tab badge number on launch when I receive a push or local notification. Accordingly, I'm trying to set this badge number from the Application Delegate. I can set the badge locally from the tab's view controller with self.tabBarItem.badgeValue
, and I can set up a method to set it开发者_JAVA百科 which I can call from the delegate, but there must be a better solution.
Any ideas?
I don't see any problem with this. It's called the AppDelegate for a reason, so that it can act as the main controller for other controllers.
精彩评论