Is there anyway to call textFieldDidEndEditing of UITextField when pressed UIButton?
Current process is function in textFieldDidEndEditing can work when user press "Return" or "Done" button and click on UIButton. To make it clear, if ABC function in textFieldDidEndEditing to be run, user must press "Return" or "Done" button of Keyboard and then click on UIButton.
What I want is I want to run function in textFieldDidEndEditing can work when user press UIButton.
Best How To :
In the button handler method, call:
This will force the keyboard to disappear and whatever the current text field had the focus will resign first responder and the
textFieldDidEndEditing: method will be called for it.
The above assumes the button handler is in the view controller class.
Since you are dealing with a custom cell and the button is in the custom cell, simply do:
self is the custom cell. This will resign any text field in the cell.