iOS Get Keyboard Focus and Hide Keyboard


Example

Get Focus

Swift

textField.becomeFirstResponder()

Objective-C

[textField becomeFirstResponder];

Resign

Swift

textField.resignFirstResponder()

Objective-C

[textField resignFirstResponder];