Note that there are some explanatory texts on larger screens.

plurals
  1. PObecomeFirstResponder slows down app when unhiding view
    primarykey
    data
    text
    <p>This is sort of a follow-up to this issue: <a href="https://stackoverflow.com/questions/5631095/becomefirstresponder-slows-down-app">becomeFirstResponder slows down app</a></p> <p>I'm experiencing the same problem as that poster, i.e. calling becomeFirstResponder seems to slow down my app (it hangs for maybe 1-2s). However, whereas they were calling it in conjunction with displaying an alert, I am simply trying to unhide a hidden view and have it appear with a certain field as the first responder. Something like:</p> <pre><code>[self.dialogView setHidden:NO]; [self.dialogText becomeFirstResponder]; </code></pre> <p>The dialogView has a hierarchy that contains dialogText (the UITextField I'm trying to set as first responder) and some other items.</p> <p>This slowness is <em>only</em> exhibited the first time this code is executed, i.e. the first time we try to open this dialog. On subsequent attempts, there is no obvious slowness (I assume this is because dialogText is already first responder at that point - I haven't used resignFirstResponder anywhere?).</p> <p>Edit: here's some additional code for context, not sure it will really shed any more light though. Note I'm now animating the unhiding of this dialog view, however the behaviour is no different. I have also since moved the becomeFirstResponder call into the completion block (not reflected in the code here) so that at least the appearance of the dialog isn't delayed, however there is still a delay between the dialog appearing and the keyboard appearing. </p> <pre><code>- (IBAction)showEditDialog:(id)sender { [UIView animateWithDuration:0.3f animations:^() { self.maskView.alpha = 0.8; self.editDialogView.alpha = 1.0; } completion:^(BOOL finished) { if (finished) { } }]; [self.editDialogText becomeFirstResponder]; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload