iOS中的键盘速度非常慢

时间:2018-05-14 11:05:55

标签: ios swift keyboard

我有一个带TextField的应用。如果TextField为空,则会显示UIAlertView一个按钮。当用户点击UIAlertView中的按钮时,他必须返回TextField。

我正在使用self.TextField.becomeFirstResponder()。有用。但问题是键盘显示得非常慢。在显示之前看起来有一秒钟的延迟。

     if TextField.text?.isEmpty ?? true {

     let alert = UIAlertController(title: "Title", message: "Text", preferredStyle: .alert)
     alert.addAction(UIAlertAction(title: "Okay", style: .cancel, handler: { (action: UIAlertAction!) in

     self.TextField.becomeFirstResponder()
     }))

     self.present(alert, animated: true)
     print("textField is empty")

     } else { ...

1 个答案:

答案 0 :(得分:1)

确保Slow Animation菜单中的Debug已停用:

enter image description here

相关问题