Reputation: 33402
Basically I want the same behavior that occurs when, on your iPhone, you go to Settings -> General -> About -> Name.
Notice that when you click on "Name", a new view appears prompting you to enter the name; and the text field is directly "selected" -- in other words, the keyboard directly pops up, without waiting for you to tap on the text field.
What I have now is a screen with a Table View that looks like this:
This screen is linked using the Storyboard segues to the rest of my interface. It works fine, but the text field doesn't directly get focus. I have to tap on it every time to make the keyboard appear.
How do I make the keyboard appear directly? Do I have to use code, or is there a way to do it in the Storyboard editor?
Upvotes: 2
Views: 2745
Reputation: 15722
I don't think there is a way to do this using storyboard only, but the way to do it in code is fairly easy. When your view loads, send a becomeFirstResponder
message to your text field.
- (void)viewDidLoad
{
[super viewDidLoad];
[self.myTextField becomeFirstResponder];
}
Upvotes: 5