“控制”;“制表键”;在iOS中使用外部键盘
我有一个有3-4个文本字段的屏幕。其中一个文本字段在尝试编辑时显示警报 但当我试图编辑其他文本字段并通过外部键盘按Tab键时,该警报将始终显示 我的代码“控制”;“制表键”;在iOS中使用外部键盘,ios,iphone,swift,xcode,uitextfield,Ios,Iphone,Swift,Xcode,Uitextfield,我有一个有3-4个文本字段的屏幕。其中一个文本字段在尝试编辑时显示警报 但当我试图编辑其他文本字段并通过外部键盘按Tab键时,该警报将始终显示 我的代码 func textFieldShouldReturn(_ textField: UITextField) -> Bool { textField.resignFirstResponder() return true } func textFieldShouldBeginEditing
func textFieldShouldReturn(_ textField: UITextField) -> Bool {
textField.resignFirstResponder()
return true
}
func textFieldShouldBeginEditing (_ textField: UITextField) -> Bool {
if textField == txt_a {
let alertController = UIAlertController(title: "Custom TextField", message: "Do your custom work here", preferredStyle: .alert)
alertController.addAction(UIAlertAction(title: "OK", style: .cancel, handler: nil))
self.present(alertController, animated: true, completion: nil)
//self.present(alertController, animated: true, completion: nil)
return false
}
return true
}
那么,我如何控制/检测**制表键
谢谢,