//设置当用户切回app时的操作 funcapplicationDidBecomeActive(application: UIApplication) { // Restart any tasks that were paused (ornot yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. //删除通知 application.cancelAllLocalNotifications() //让角标消失 application.applicationIconBadgeNumber = 0 }