Detect back space for secure text field. Delegate method for detecting backspace key

StackOverflow https://stackoverflow.com/questions/18010483

  •  04-06-2022
  •  | 
  •  

Pergunta

Possible duplicate Detect backspace in UITextField

I am having 5 secure password text field which accepts 1 character each. When you enter 1 character in a text field then the next textfield becomes first responder. The problem occurs when i press "BACK SPACE" button.

My requirement is : When i press back button in an empty text field, it should detect the backspace button press and cursor should navigate to the previous text field and previous text field becomes first responder.

What is happening is when i press the back button in an empty text field, the back space is not detected and it stays in the same empty text field.

As suggested in this link Detect backspace in UITextField i have tried putting zero width space character \u200B white editing did begin but it takes it as character and becomes visible in text field. Any help is highly appreciated.

Foi útil?

Solução

The following link have a solution from Jacob Caraballo which helped me solve my problem,

Detect backspace in UITextField

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top