Skip to content

Instantly share code, notes, and snippets.

@akultomar17
Created December 19, 2017 18:53
Show Gist options
  • Save akultomar17/2e4aa8500b7a744a550bb2c2b80d1363 to your computer and use it in GitHub Desktop.
Save akultomar17/2e4aa8500b7a744a550bb2c2b80d1363 to your computer and use it in GitHub Desktop.
func showError(error: LAError) {
var message: String = ""
switch error.code {
case LAError.authenticationFailed:
message = "Authentication was not successful because the user failed to provide valid credentials. Please enter password to login."
break
case LAError.userCancel:
message = "Authentication was canceled by the user"
break
case LAError.userFallback:
message = "Authentication was canceled because the user tapped the fallback button"
break
case LAError.touchIDNotEnrolled:
message = "Authentication could not start because Touch ID has no enrolled fingers."
break
case LAError.passcodeNotSet:
message = "Passcode is not set on the device."
break
case LAError.systemCancel:
message = "Authentication was canceled by system"
break
default:
message = error.localizedDescription
break
}
self.showPopupWithMessage(message)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment