Trouble shooting becomeFirstResponder not showing keyboard for some users Trouble shooting becomeFirstResponder not showing keyboard for some users ios ios

Trouble shooting becomeFirstResponder not showing keyboard for some users


I called becomeFirstResponder later by this line:

[self.searchBar performSelector:@selector(becomeFirstResponder)                      withObject:nil                      afterDelay:0.1f];

It worked for me. Hope this help.


The textview has not finished being drawn by the time you try to make it the first responder.

You can try animating the appearance and setting the first responder in the completion block.

[UIView animateWithDuration:0.0 animations:^{   [view addSubview:textView];} completion:^(BOOL finished){   [textView becomeFirstResponder];}];


As of iOS8, calling becomeFirstResponder on a UITextView doesn't show the keyboard for me on the iOS simulator, but it does on the real device. So be sure to check it with an actual device. This doesn't happen on iOS7 though.