1

I show Touch ID in my Passcode View Controller (it's presented as modal view controller) by context.evaluatePolicy(LAPolicy.deviceOwnerAuthenticationWithBiometrics, localizedReason: message

But sometimes I need to dismiss Passcode View Controller programatically before user enters his fingerprint. In this case alert with touch ID stays on its place. How can I dismiss this Touch ID alert too?

Paul T.
  • 4,938
  • 7
  • 45
  • 93

1 Answers1

1

Declare

LAContext *myContext;
if ([myContext canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:&authError]) {
    [myContext evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics
              localizedReason:myLocalizedReasonString
                        reply:^(BOOL success, NSError *error) {
                            if (success) {
} else {
}];

add this line where do you want to dismiss touch id view

    [myContext invalidate];
Bhadresh Sonani
  • 90
  • 1
  • 11