func application(application: UIApplication, didReceiveRemoteNotification userInfo: [NSObject : AnyObject], fetchCompletionHandler completionHandler: (UIBackgroundFetchResult) -> Void) {
badge = badge + 1
application.applicationIconBadgeNumber = badge
let vc = application.keyWindow?.rootViewController as? UITabBarController
if application.applicationState == UIApplicationState.Inactive {
vc?.selectedIndex = 3
}
}
网友评论