是否有办法确定是否已注册指纹,但Touch ID目前处于"暂停"状态是因为指纹认证失败太多了?
答案 0 :(得分:2)
可以将错误代码与LAError类进行比较。
func errorMessageForLAErrorCode( errorCode:Int ) -> String{
var message = ""
switch errorCode {
case LAError.AppCancel.rawValue:
message = "Authentication was cancelled by application"
case LAError.AuthenticationFailed.rawValue:
message = "The user failed to provide valid credentials"
case LAError.InvalidContext.rawValue:
message = "The context is invalid"
case LAError.PasscodeNotSet.rawValue:
message = "Passcode is not set on the device"
case LAError.SystemCancel.rawValue:
message = "Authentication was cancelled by the system"
case LAError.TouchIDLockout.rawValue:
message = "Too many failed attempts."
case LAError.TouchIDNotAvailable.rawValue:
message = "TouchID is not available on the device"
case LAError.UserCancel.rawValue:
message = "The user did cancel"
case LAError.UserFallback.rawValue:
message = "The user chose to use the fallback"
default:
message = "Did not find error code on LAError object"
}
return message
}