I have a UITextField that I want to set into editing mode (keyboard on screen and cursor in text field box) programatically.  I know that the user will be in editing mode when this view appears onscreen, so I want to save the user from having to tap the text field.  
The "editing" property of a UITextField is read only - so that doesn't work.  Is there a way to set the UITextField into editing mode, with a keyboard onscreen, programmatically?  
Call becomeFirstResponder on the UITextField.
Related question: How do I show the keyboard by default in UITextView?
You have to call [textField becomeFirstResponder];
Indeed call [textField becomeFirstResponder] in Obj-C or textField.becomeFirstResponder() in Swift.
However, make sure you call this in the viewDidAppear and not in the viewDidLoad to prevent strange behaviour (see: When set UITextField as FirstResponder programmatically, cause some weird actions on text editing).
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