点击通知操作时,iOS应用会冻结

时间:2017-05-16 13:07:50

标签: ios objective-c uiviewcontroller appdelegate unusernotificationcenter

 -(void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)())completionHandler{

 dispatch_async(dispatch_get_main_queue(), ^{
 LSAddActivityViewController *addVC = [[LSAddActivityViewController alloc]init];
           addVC.leadID = LeadID;
           addVC.activityType = @"Notable Activity";
           [((UINavigationController *)self.window.rootViewController) 
           pushViewController:addVC animated:YES];

});
completionHandler();
}

UNUserNotificationCenter本地通知上点击操作时,将执行上面的代码。 LSAddActivityViewController正在使用适当的用户界面启动,但应用程序冻结,应用程序上的任何位置都无法触摸。

注意 - 在方向更改时,UI正在重新绘制完美。 self.view.userInterationEnabled总是如此。

0 个答案:

没有答案