1:添加LocalAuthentication.framework框架
2:实现过程
#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");
}
}

最新文章

  1. php 常见的问题
  2. Java中的Comparable&lt;T&gt;和Comparator&lt;T&gt;接口
  3. jsonp获取服务器数据的方式
  4. bjfu1109 最小公倍数和
  5. poj 3007 Organize Your Train part II(静态字典树哈希)
  6. dojo.io.script
  7. SystemParametersInfo API学习(128个中文参数解释,215个实际值)
  8. 进一步解 apt-get 的几个命令
  9. 聊聊Java中几种常用的设计模式
  10. Multi-Projector Based Display Code ---- ImageViewer
  11. 基于jmeter的性能测试平台(一)分布式jmeter搭建
  12. Android basics
  13. 关于windows下的虚拟机Homestead在推送代码上github 步骤
  14. zabbix server配置文件参数详解
  15. python 函数调用顺序
  16. SEO-搜索引擎优化
  17. Dom操作(标签--增、删、移动)
  18. vue轮播图
  19. npm常见配置收集
  20. EntityFramework 学习 一 Validate Entity

热门文章

  1. input 字符限制
  2. 熊猫TV提示“您的账号存在被盗风险,请在网站上登录解锁”
  3. Spring整合activiti-modeler5.16遇到的小问题
  4. Sublime Text 介绍、用法、插件等
  5. 【SQL Server】系统学习之二:索引优化
  6. 基于List集合映射
  7. c++学习-继承
  8. unsigned char 转字符串:
  9. 树莓派,使用opencv调用自带的摄像头
  10. 在linux下通过sh运行java程序