How can I programmatically assign focus to a specific UITextField in a view? I have several fields and on view display, I'd like to put the cursor on a specific field, not the first one at top.
An object that displays an editable text area in your interface.
Use the blur() method to remove the focus from an element, e.g. input. blur() . If you need to remove the focus from the currently active element without selecting it, call the blur method on the activeElement property - document.
A text field is a rectangular area in which people enter or edit small, specific pieces of text.
Try doing this in viewWillAppear:
[desiredField becomeFirstResponder];
By making the field the first responder, it have focus and the keyboard will be displayed.
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