jac*_*zki 1 objective-c ios touch-id
我知道这可能是一个简单的问题,但我无法在互联网上找到想要的东西。我在项目中使用的是iOS 8中的LocalAuthentication框架,代码在这里:
if ([context canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:&error]) {
[context evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics
localizedReason:@"Let's just quickly check that you are the device owner."
reply:^(BOOL success, NSError *error) {
dispatch_async (dispatch_get_main_queue(), ^{
if (error) {
// Error occurred
} else if (success) {
// Device owner, success!
} else {
// Not device owner
}
});
}];
}
Run Code Online (Sandbox Code Playgroud)
但是我想知道用户何时点击“输入密码” LAErrorUserFallback。但是,我只想知道如何将error我那里的变量与进行比较,LAErrorUserFallback以查看结果错误。
我已经试过了:
if (error) {
if (error == LAErrorUserFallback) {
// User tapped 'Enter password'
}
}
Run Code Online (Sandbox Code Playgroud)
但显然这些不是同一类型。
有什么帮助吗?
| 归档时间: |
|
| 查看次数: |
509 次 |
| 最近记录: |