iOS指纹识别功能
来源:互联网 发布:淘宝四大化妆刷店 编辑:程序博客网 时间:2024/05/01 21:04
第一步:老地方导入第三方库:LocalAuthentication.framework
第二步:在需要指纹解锁的地方导入头文件
#import "LocalAuthentication/LAContext.h"
第三步:关键代码
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{ LAContext * muContext = [[LAContext alloc]init]; NSError * autherror = nil; NSString *myLocalizedReasonString = @"We need to verify your fingerprint to confirm your identity"; if ([muContext canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:&autherror]) { [muContext evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics localizedReason:myLocalizedReasonString reply:^(BOOL success, NSError * _Nullable error) { if (success) { NSLog(@"指纹验证成功"); }else{ //验证三次不成功就会走这个方法 NSLog(@"指纹验证失败"); } }]; }else{ NSLog(@"系统没有开启指纹模式,或者用户多次验证指纹失败!"); }}
结束!!!!
0 0
- iOS指纹识别功能
- iOS 8 SDK Touch ID指纹识别功能
- iOS指纹识别
- iOS指纹识别
- ios指纹识别
- iOS 指纹识别
- iOS 指纹识别
- iOS指纹识别
- iOS 指纹识别
- iOS 指纹识别
- iOS 指纹识别
- ios指纹识别
- iOS指纹识别
- iOS 指纹识别
- iOS 指纹识别
- 使用iOS 8 SDK添加Touch ID指纹识别功能
- 使用iOS 8 SDK添加Touch ID指纹识别功能
- 使用iOS 8 SDK添加Touch ID指纹识别功能
- 二、Android 数据链接的动态分析
- 全同态加密算法
- cookie存储
- MongoDB——第七天 运维技术
- ubuntu 安装php7 mongodb扩展
- iOS指纹识别功能
- 学习笔记1220
- 14.11 InnoDB and Online DDL
- 剑指offer -重建二叉树
- 为设计人员准备的8个最好的免费线框图绘制工具
- 数据结构(七)
- TopCoder SRM 561 Orienteering 题解
- 利用投影算法来计算系统矩阵左乘和右乘
- 自定义NSLog宏输出