I am presenting a UIViewController from another UIViewController. The presented view controller implements viewDidAppear as such:
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
[self.addressTextView becomeFirstResponder];
}
However, if I implement viewDidAppear like this:
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
[self.addressTextView performSelector:@selector(becomeFirstResponder) withObject:nil afterDelay:0.0f];
}
There's no noticeable delay in the presentation animation.
My main question is, does anyone know if there's a another way to make the text field become first responder, without delaying my present animation? I do not consider the second solution clean. I'm relying on some implementation detail of how perform selector works to get the functionality I want. I'd rather not.
I'm also curious why there's such a delay with the first method and how the first method differs from the second method "behind the scenes".
edit: It's perhaps worth noting that the delay in the present view controller animation only occurs the FIRST time it's presented.