Touch id default alert partially hides keyboard from the screen

641 views Asked by At

While authenticating user with touch id, The pop-up will appear in the window, but keyboard view has partially disappeared (the accessory view does not dismiss with keyboard) from the window. I have added a screenshot for your reference

enter image description here

Actually, we expected the result like this one

enter image description here

I called below code to authenticate the user from viewDidLoad function. If we click a text field before the authentication state. The problem will occur.

LAContext *context = [[LAContext alloc] init];

context.localizedFallbackTitle = @"";

NSError *error = nil;
if ([context canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:&error]) {

    // If pass coed set means this loop
    [context evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics localizedReason:@“Login With your Touch ID” reply:^(BOOL success, NSError *error) {

      if (error) {
       dispatch_async(dispatch_get_main_queue(), ^{
        // show error message
       });

      return;
      }

     if (success) {
       // allow user to a/c section
     } else {
      // Will add wrong user message
     }

   }];

Please help us to resolve this issue. Thanks!

1

There are 1 answers

1
Maulik Bhuptani On

To prevent this , you should use [self.view setUserInteractionEnabled:false]; in viewDidLoad and in touch id access block again

dispatch_async(dispatch_get_main_queue(), ^{ [self.view setUserInteractionEnabled:true]; });

You also need to monitor whether device supports touch id access or not