What exactly are the differences between the UIControlEvents
.EditingDidEnd
and .EditingDidEndOnExit
, and how do they relate to each other?
The documentation on UIControl is pretty vague, and has no information of whether these fire for different reasons, if one is a superset of the other, or if they're functionally equivalent.
The possibility of one being a superset is especially confusing, since the naming implies that .EditingDidEndOnExit
is a specific occurrence of .EditingDidEnd
, but the documentation seems to imply the opposite.
".EditingDidEnd
" is called when somebody touches outside of the bounds of the text field, because they're likely about to interact with some other control or object.
"EditingDidEndOnExit
" is called when the user clicks the "return
" key in the keyboard (and you're right, it's not clear in the documentation... but if you look at the UIControl.h file you'll see a comment reflecting this point).
From the UIControl header:
UIControlEventEditingDidEnd = 1 << 18,
UIControlEventEditingDidEndOnExit = 1 << 19, // 'return key' ending editing
So one is when the return key was pressed, the other is from touching outside of the bounds.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With