ios - UIAlertController的Action事件反应有点慢?

浏览:68日期:2023-11-17

问题描述

直接贴上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:

我用你代码写了一个demo,发现并没有2秒的延迟。

说明你代码的问题不是这一块内容。

相关文章: