search

Home  >  Q&A  >  body text

ios - UIAlertController's Action event response a bit slow?

Directly paste Button’s click event:

    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)
    }
The

pop of navigationController feels very slow. After clicking to , I feel there is a 2-second delay before returning to the upper interface. WeChat gives up changing the payment password. , the interface returned immediately after clicking. Does anyone know any solution?

ringa_leeringa_lee2742 days ago873

reply all(1)I'll reply

  • 仅有的幸福

    仅有的幸福2017-05-17 10:06:26

    I wrote a demo using your code and found that there is no 2 second delay.

    It means that the problem with your code is not this part.

    reply
    0
  • Cancelreply