Remus Rusanu
Remus Rusanu

Reputation: 294237

Programmatically show the keyboard on iPhone app

I have a view with only one UITextView that is used to enter a value. I want that when the view shows, the textview becomes the first responder (that's the easy part) and also the default keyboard shows up. I tried searching for this in speca but to no avail. There are many posts on how to dismiss the keyboard, but what I want is to show the keyboard w/o waiting for user to touch my textview.

Upvotes: 6

Views: 8859

Answers (1)

pix0r
pix0r

Reputation: 31280

Just setting the text field to firstResponder should do the trick.

Inside your -viewDidLoad:

[myTextField becomeFirstResponder];

Upvotes: 15

Related Questions