Skip to content

Commit

Permalink
Merge pull request #915 from joshbruhin/Bridge-1684
Browse files Browse the repository at this point in the history
Call becomeFirstResponder with dispatch to main queue after delay
  • Loading branch information
umerkhan-apple committed Mar 14, 2017
2 parents 0f5dca3 + 0d11c9f commit 47191bf
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion ResearchKit/Common/ORKPasscodeStepViewController.m
Expand Up @@ -379,7 +379,17 @@ - (void)promptTouchId {
}]];
[strongSelf presentViewController:alert animated:YES completion:nil];
} else if (error.code == LAErrorUserCancel) {
[strongSelf makePasscodeViewBecomeFirstResponder];

// call becomeFirstResponder here to show the keyboard. dispatch to main queue with
// delay because without it, the transition from the touch ID context back to the app
// inexplicably causes the keyboard to be invisble. It's not hidden, as user can still
// tap keys, but cannot see them

double delayInSeconds = 0.3;
dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC));
dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
[strongSelf makePasscodeViewBecomeFirstResponder];
});
}

[strongSelf finishTouchId];
Expand Down

0 comments on commit 47191bf

Please sign in to comment.