美文网首页
解决UIAlertController弹出时的卡顿

解决UIAlertController弹出时的卡顿

作者: 闲云悠鹤蝶恋舞 | 来源:发表于2018-07-25 17:29 被阅读19次
描述:当我们在tableView的代理方法里面,弹出alert弹框时,总感觉有些卡顿。

解决办法:
将presentViewController写在主线程即可解决问题!

// 将presentViewController写在主线程即可解决问题!
dispatch_async(dispatch_get_main_queue(), ^{
    [self presentViewController:alertC animated:YES completion:nil];
});

相关文章

网友评论

      本文标题:解决UIAlertController弹出时的卡顿

      本文链接:https://www.haomeiwen.com/subject/eocmmftx.html