我试图检查文本字段何时更改,相当于textView使用的函数 - textViewDidChange到目前为止我已经这样做了:
func textFieldDidBeginEditing(textField: UITextField) {
if self.status.text == "" && self.username.text == "" {
self.topRightButton.enabled = false
} else {
self.topRightButton.enabled = true
}
}
Run Code Online (Sandbox Code Playgroud)
哪种工作,但topRightButton只要按下文本字段就启用,我希望只有在实际输入文本时才能启用它?