You can use the target on your textField with the EditingChanged control EditingChanged instead of the delegate method.
Swift> = 1.0
myTextField.addTarget(self, action: "didChangeText:", forControlEvents: .EditingChanged)
Swift 3.0 (string literal selectors are deprecated, use #selector)
myTextField.addTarget(self, action: #selector(didChangeText(_:)), for: .editingChanged)
Then use the target method to perform the checks.
func didChangeText(textField:UITextField) { if textField.text == "apple" { checkImageView1.hidden = false } else { checkImageView1.hidden = true } }
source share