Short answer: Make sure you donβt have any code that spoils the 'editing' property on UITextField.
I had the same symptoms when I definitely set the delegate correctly, and textFieldDidBeginEditing and textFieldDidEndEditing were called, but textFieldShouldReturn and shouldChangeCharactersInRange were not called. I also could not enter any characters, but I could copy the paste into the text box. In my case, I also accidentally placed text fields inside cells in a UITableView. My situation was slightly different from the fact that the delete button does not work.
Where I did wrong was that I did not use the raw UITextField in my cells, I had my own subclass of UITextField. My subclass had the isEditing property, which I changed in the UITextFieldDelegate methods and used to figure out how to scroll through the table view when selecting a text field. This was an override of the isEditing method on a UITextField, which is used as a getter for the editing property of UITextField. As soon as I got rid of my isEditing subclass, everything went as expected.
source share