I\'d like to change the background image of a UITextField when it becomes the firstResponder to show the user that it has focus, similar to the :active or :focus pseudo-clas
SWIFT 4
textField.addTarget(self, action: #selector(anyFunction), for: UIControlEvents.editingDidBegin) @objc func anyFunction() { // Add your conde here }