It depends what you want to do when you have tapped in the UITextField.
Normally, you would implement the UITextFieldDelegate protocol to intercept the various events that happen in a UITextField. Setting a selector for an action is not the best way to handle that kind of scenario and .touchDown
is not the best action to intercept.
You should also investigate the UIResponder methods, especially canBecomeFirstResponder
, becomeFirstResponder
, canResignFirstResponder
and resignFirstResponder
. These get called when you tap into or out of a UITextField.