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

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.

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

Related

How to disable text input for a label but still have it as a button

The Text Fields that Say 100 are the ones i'm referring to.
I have Text Fields that I don't want to be editable until a later point so I turned off User Interaction. However, I still want them to function as a button to go to another view. Is there anyway to turn off text input but still keep it as a button?

How to delete continuously delete text in a TextFormField when the backspace is kept down?

I got a TextFormField controlled by a TextEditingController. I have found no way to remove continuously, one by one, all the characters on the field if the user keeps the backspace pressed on mobile.
The behavior should be similar to what you would expect when writing an email, or text in a document, etc.

Selecting all text in a UITextField when an user has VoiceOver enabled

In my App I have several text fields which a user can edit. If the text field already contains text and the user begins to edit the text field, I want to highlight all text, so it's easier for the user to delete the content of the field.
Searching the web I have found the solution to set the text fields delegate to self and use the function didBeginEditing(). In this function I just call textField.selectAll(nil). As long as I don't use VoiceOver on the phone this works well. As soon as you turn VoiceOver on the text in a textField doesn't get highlighted when beginning to edit the text field. The function didBeginEditing though is still called. I checked this with a simple print statement.
Has anyone an idea why this isn't working? Is there maybe another way to highlight all text in a text field?
Thank you for every answer!
The selection of text is lost when the VoiceOver selects the element. You should select the text after the VoiceOver focus on element.
On didBeginEditing you can check if
UIAccessibility.isVoiceOverRunning and then you select the text after one second.
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 1) {
self.textField.selectAll(nil)
}
Not the best solution, but it's working. Also, for a person with vision problem I don't think is useful to select all the text, eventually you should inform the user that the text is selected.

iPhone Go button Does not apper if textarea is the last input

I have this weird issue with a form on one of my sites. Form have 2 input fields a text input and a textarea under it. Submit button at the bottom and it is inout type sumit.
When I type in text input "GO" button appears on the keyboard, but, when typing in textarea it turns to "return" button.
If i change location of inputs so that text input is the last Go button appears as usually. as I fill text are first.
Is it possible to get Go button appear while typing in textarea?
Go to your laptop or desktop and click a textarea. Pressing the enter button does not submit the form.
The answer to your question is therefore simple: a textarea is a multiline input field which requires a return button, leaving no space for the go button. The answer is no. Use a normal input instead.

track user input from UIKeyboard

How can I get user input of the UIKeyboard on the iPhone?
I want to track, if the user hits "backspace" when the firstResponder UITextField is empty.
I know how I can track a text change but if the field is empty the text don't change when hit "backspace".
You can put a single space character as the default textfield text. If it tries to disappear in your textshouldchange delegate then the user hit a backspace. You can remove the leading space before actually using the text result.