When I create UITextField inside Interface Builder, I can access Events tab for it, which has events like Value changed, Touch cancel, Touch drag, etc. I can assign my own m
Instead of UIControlEventValueChanged
, you should use UIControlEventEditingChanged
:
[_titleTextField addTarget:self action:@selector(handleTitleValueChanged:) forControlEvents:UIControlEventEditingChanged];
Refer to Apple documentation for UIControl
. After initializing your textField
, call addTarget:action:forControlEvents:
example for the touch event ending an edit session
[textField addTarget:self action:@selector(handleTouchValueChanged:) forControlEvents: UIControlEventEditingDidEnd]
UIControlEventEditingChanged
fires whenever user changes value [synchronous with typing or keyup]
which could cause extra hits to your data handler routine, if you're saving values based on that event, expecting it to be some kind of final value from user input...