佚名通过本文主要向大家介绍了uialertcontroller,action事件,actionevent事件,反应停事件,乐天事件群众反应等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
问题: UIAlertController的Action事件反应有点慢?
描述:
解决方案1:
描述:
直接贴上Button的点击事件:
func cancelButton() {
let alertCtrl = UIAlertController.init(title: "是否放弃修改支付密码?", message: nil, preferredStyle: UIAlertControllerStyle.alert)
alertCtrl.addAction(UIAlertAction.init(title: "否", style: UIAlertActionStyle.cancel, handler: nil))
alertCtrl.addAction(UIAlertAction.init(title: "是", style: UIAlertActionStyle.default, handler: { (action: UIAlertAction) in
self.navigationController?.popViewController(animated: true)
}))
self.present(alertCtrl, animated: true, completion: nil)
}
navigationController
的pop
感觉特别慢,点击是
之后,感觉有个2秒的延迟才返回上层界面,微信的放弃修改支付密码,点完之后界面立马返回了,有没有谁知道有什么办法?
解决方案1:
你的闭包内代码加入主线程试试
解决方案2:我用你代码写了一个demo,发现并没有2秒的延迟。
说明你代码的问题不是这一块内容。