If you are trying to display a picker for a text field instead of a keyboard, you must designate the picker picker inputView as the inputView text field.
But if you want to run any method when the user touches the text field, you must override the delegate method of the text field
textFieldDidBeginEditing
and cause the first responder to resign to escape the keyboard, and then write your own code or method calls.
source share