TouchID
2015-11-02 14:54
183 查看
TouchID 简单介绍
引入头文件LocalAuthentication/LocalAuthentication.h
@property (nonatomic ,retain) LAContext *context; //指纹验证操作对像
//初始化TouchID
引入头文件LocalAuthentication/LocalAuthentication.h
@property (nonatomic ,retain) LAContext *context; //指纹验证操作对像
//初始化TouchID
- (void)initTouchID { self.context = [[LAContext alloc]init]; NSError *error; self.context.localizedFallbackTitle = @"手动输入密码"; if ([_context canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:&error]) { NSLog(@"可以用"); [self.context evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics localizedReason:@"asdas" reply:^(BOOL success, NSError * _Nullable error) { if (success) { NSLog(@"通过"); } //错误信息 感兴趣的查一下api else if (error.code == kLAErrorTouchIDLockout) { NSLog(@"手动输入密码"); } else if (error.code == kLAErrorSystemCancel) { NSLog(@"点击了取消"); } else if(error.code == kLAErrorAuthenticationFailed) { NSLog(@"指纹解锁失败"); } }]; } else { NSLog(@"不可用, %@",error); } }
相关文章推荐
- 仿淘宝底栏点击效果
- boost bind性能开销分析
- 用条件格式提高数据易用性(5)-找特定值 设计要点:可视化、条件格式
- python中关于装饰器的理解
- MySQL修改配置 区分大小写和不区分大小写
- eclipse IDE的常用快捷键
- WINDOWS语言包对应关系表
- Object-C NSSet类型
- linux 文件夹和文件的创建和删除操作
- 内容编码
- 蓝色系微商城界面设计
- 解决新手引导图片被导航栏遮盖住得问题
- create tablespace
- ExpandableListView的用法
- java性能优化(干货)--降低时间与空间消耗
- 使用XIB实现嵌套自定义XIB视图
- 淘宝穿衣搭配算法_方案四
- 大话数据结构——第一、二章
- 大杂烩
- Core Data 入门