Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let touchIDContext = LAContext()
- var touchIDError : NSError?
- let reasonString = "Too much control for more then one person"
- // Check if we can access local device authentication
- if touchIDContext.canEvaluatePolicy(LAPolicy.deviceOwnerAuthenticationWithBiometrics, error:&touchIDError) {
- // Initiate authentication
- touchIDContext.evaluatePolicy(LAPolicy.deviceOwnerAuthenticationWithBiometrics, localizedReason: reasonString, reply: {
- (success: Bool, error: Error?) -> Void in
- // Check if authentication was successful
- if success {
- // Do something after authentication
- userAuthenticated()
- }
- } )
- } else {
- // No Touch-ID sensor, proceed to manual PIN entry
- initPinAuth()
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement