min platform : 8.0
#import <LocalAuthentication/LocalAuthentication.h>
LAContext *context = [[LAContext alloc] init];
NSError *error = nil;
if ([context canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:&error]) {
[context evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics localizedReason:@"指纹解锁" reply:^(BOOL success, NSError *error) {
if (success) {
[[NSOperationQueue mainQueue] addOperationWithBlock:^{
self.labelLevel.text = @"指纹验证成功";
}];
}
else
{
NSLog(@"%@",[error description]);
}
}];
}