ios 指纹识别解锁

:添加LocalAuthentication.framework框架
:实现过程
#import "ViewController.h"
#import <LocalAuthentication/LAContext.h>
@interface ViewController () @end @implementation ViewController - (void)viewDidLoad {
[super viewDidLoad]; LAContext *myContext = [[LAContext alloc]init];
myContext.localizedFallbackTitle = @"忘记密码"; NSError *error = nil;
NSString *myLocalizedReasonString = @"请输入指纹";
if ([myContext canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:&error]) { [myContext evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics localizedReason:myLocalizedReasonString reply:^(BOOL success, NSError *error) { if (success) { NSLog(@"success"); } else { // User did not authenticate successfully, look at error and take appropriate action
NSLog(@"did not authenticate successfully"); } }]; } else { // Could not evaluate policy; look at authError and present an appropriate message to user
NSLog(@"Could not evaluate policy");
} }

ios 指纹识别解锁

ios 指纹识别解锁

上一篇:IOS 指纹识别的简单使用


下一篇:centos防火墙控制与转发端口