Skip to content

Instantly share code, notes, and snippets.

@fitomad
Created October 3, 2018 08:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fitomad/10c5f09f3548fbbb3b71e6967a19cea9 to your computer and use it in GitHub Desktop.
Save fitomad/10c5f09f3548fbbb3b71e6967a19cea9 to your computer and use it in GitHub Desktop.
...
self.authenticationContext = LAContext()
var errorPolicy: NSError?
if self.authenticationContext.canEvaluatePolicy(.deviceOwnerAuthentication, error: &errorPolicy)
{
...
}
else
{
let message = errorPolicy?.localizedDescription ?? NSLocalizedString("AUTHENTICATION_POLICY_ERROR_MESSAGE", comment: "")
print(message)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment