Skip to content

Commit 31bf918

Browse files
committed
Changed Touch ID behaviour
1 parent df9c773 commit 31bf918

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

TOPasscodeViewControllerExample/ViewController.m

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,22 @@ - (void)didPerformBiometricValidationRequestInPasscodeViewController:(TOPasscode
103103
return;
104104
}
105105

106-
// The user hit the 'Cancel' button in the Touch ID dialog
107-
// (Use this to dismiss the controller if desired, but do not show the protected content)
106+
// The user hit 'Enter Password'. This should probably do nothing
107+
// but make sure the passcode controller is visible.
108+
if (error.code == kLAErrorUserFallback) {
109+
NSLog(@"User tapped 'Enter Password'");
110+
return;
111+
}
112+
113+
// The user hit the 'Cancel' button in the Touch ID dialog.
114+
// At this point, you could either simply return the user to the passcode controller,
115+
// or dismiss the protected content and go back to a safer point in your app (Like the login page).
108116
if (error.code == LAErrorUserCancel) {
109-
[weakSelf dismissViewControllerAnimated:YES completion:nil];
117+
NSLog(@"User tapped cancel.");
110118
return;
111119
}
112120

113-
// The other main error would be if the user hit 'Enter Passcode', in which case they can enter
114-
// their passcode manually into the passcode controller
121+
// There shouldn't be any other potential errors, but just in case
115122
NSLog(@"%@", error.localizedDescription);
116123
};
117124

0 commit comments

Comments
 (0)