From the course: Biometric Authentication for iOS in Swift

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Handling cancels

Handling cancels

From the course: Biometric Authentication for iOS in Swift

Start my 1-month free trial

Handling cancels

- [Instructor] So, we're handling various errors for the can evaluate policy and the evaluate policy. Let's look at what other ones are available. So, I'm going to Control + Command + Click on userCancel, and we can look at the various values for this enumeration of code, authenticationFailed, userCancel, userFallback, systemCancel, where another application went to the foreground, passcodeNotSet, and so forth, and here's an interesting one, appCancel. So, let's say you have a timed expiration time, or a timeout where if the user doesn't validate, they move on. So, let's handle the case of the appCancel. So, back in our code we're going to add another case on line 48, case LAError.Code.appCancel. And I'll print app canceled. I know I'm using the British spelling, my fingers are British, they type it that way. But how do we do an appCancel? We have to call invalidate on the context. So, let's do that on a timer so that when evaluate policy is called some time later, we're going to do…

Contents