iphone - Can I detect the delete key even if the UITextField is empty? -


when uitextfield contains nothing, pressing delete key of keyboard won't call of uitextfielddelegate's methods.

how can detect it?

edit: there seems no trivial way it. useful links can find are:

  1. uitextfield : way detect delete key event when field empty ?

  2. how actual key pressed in uitextfield

in short, solution put permanent space @ start of text field. , make other nesessary changes(textfieldshouldreturn:, textfield:shouldchangecharactersinrange:replacementstring:, etc.).

its possible put button on it, that's bit fragile since keyboard layout change different ios versions , there different keyboard layouts different languages.

look @ "managing text fields , text views" apple doc. im sure there way this. uitextfield implements protocol keyevents. 1 of key events delete key, override whatever method receives these , way.


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -