[Swift] Automatically make keyboard show

ajbudis

macrumors newbie
Original poster
Jun 30, 2013
20
0
Hello All!

I'm trying to make the keyboard automatically show when opening the app. The keyboard would open and allow for immediate typing in a Line Style Text Field. This is of course in the language Swift.


Any help is greatly appreciated.

AB
 

kage207

macrumors 6502a
Jul 23, 2008
961
8
You can do in your viewDidLoad (but better viewDidAppear) to do:

Objective-C:
Code:
[yourTextField becomeFirstResponder]
Swift:
Code:
yourTextField.becomeFirstResponder()
This is in UIResponder class.
 

grandM

macrumors 65816
Oct 14, 2013
1,099
56
Hello All!

I'm trying to make the keyboard automatically show when opening the app. The keyboard would open and allow for immediate typing in a Line Style Text Field. This is of course in the language Swift.


Any help is greatly appreciated.

AB
removing it is done by
Code:
yourTextField.resignFirstResponder()