Skip to content

Instantly share code, notes, and snippets.

@akultomar17
Last active December 19, 2017 18:55
Show Gist options
  • Save akultomar17/e7d16b49a239835e18a6474f883e5bb0 to your computer and use it in GitHub Desktop.
Save akultomar17/e7d16b49a239835e18a6474f883e5bb0 to your computer and use it in GitHub Desktop.
func evaulateTocuhIdAuthenticity(context: LAContext) {
guard let lastAccessedUserName = UserDefaults.standard.object(forKey: "lastAccessedUserName") as? String else { return }
context.evaluatePolicy(LAPolicy.deviceOwnerAuthentication, localizedReason: lastAccessedUserName) { (authSuccessful, authError) in
if authSuccessful {
} else {
if let error = authError as? LAError {
showError(error: error)
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment