Created
December 19, 2017 18:53
-
-
Save akultomar17/2e4aa8500b7a744a550bb2c2b80d1363 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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