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 editin
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).