If I copy abc 123
, and paste it into my UITextField
, I’d like abc123
to be entered. I’m trying to use shouldChangeCharactersInRange:replacementString
from UITextFieldDelegate
, but changing the replacementString
argument doesn’t change what actually appears in the field.
I can return NO
if the string contains spaces, but what I’d like to do is actually strip them at the point of entry. There doesn’t appear to be any other delegate method to do this.
How might I achieve this, preferably without subclassing the UITextField
and overriding paste:
?