TouchID的使用
来源:互联网 发布:ae软件下载 编辑:程序博客网 时间:2024/06/06 10:45
//// ViewController.m// touchID_Demo_oc//// Created by Blake on 14/12/8.// Copyright (c) 2014年 Blake. All rights reserved.//#import "ViewController.h"#import <LocalAuthentication/LocalAuthentication.h>@interface ViewController ()@end@implementation ViewController- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib.}- (IBAction)clicked:(UIButton *)sender { LAContext* lacontext = [LAContext new]; NSError* error = nil; if ([lacontext canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:&error]) { [lacontext evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics localizedReason:@"APP需要验证您的指纹信息" reply:^(BOOL success, NSError *error) { if (success) { UIAlertController* alert = [UIAlertController alertControllerWithTitle:@"提示" message:@"验证成功" preferredStyle:UIAlertControllerStyleAlert]; [alert addAction:[UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleCancel handler:nil]]; [self presentViewController:alert animated:YES completion:nil]; }else{ UIAlertController* alert = [UIAlertController alertControllerWithTitle:@"提示" message:@"验证失败" preferredStyle:UIAlertControllerStyleAlert]; [alert addAction:[UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleCancel handler:nil]]; [self presentViewController:alert animated:YES completion:nil]; } }]; }else{ UIAlertController* alert = [UIAlertController alertControllerWithTitle:@"提示" message:@"设备无法验证,请输入密码" preferredStyle:UIAlertControllerStyleAlert]; [alert addAction:[UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleCancel handler:nil]]; [self presentViewController:alert animated:YES completion:nil]; }}- (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated.}@end
随着新款iPhone,iPad等电子设备上市,越来越多的设备开始支持touchID,touchID的用法很简单,做一个简单地例子贴出来,
0 0
- TouchID的使用
- iOS TouchID的使用
- ios TouchID的使用
- touchID的使用和编程
- IOS8 TouchID使用介绍
- iOS8使用TouchID
- ios使用touchId
- iOS_使用LAContext实现TouchID(指纹识别)的使用
- TouchID
- touchid
- TouchID
- touchID
- iOS TouchID验证和Keychain结合使用
- 简单的 TouchID demo 的使用 && UIlaterView block的封装。希望看完的你 举一反三, UIAlertController添加一样的block回调
- ios touchid
- iOS8:TouchID
- iOS8:TouchID
- iOS TouchID
- Linux技巧——用dd生成指定大小的文件
- error C2664: “countChar”: 不能将参数 1 从“char [20]”转换为“std::string &”
- oracle中sql语句的优化(转帖)
- 计算绝对值,可以不需要if、else?
- data structure in PCL
- TouchID的使用
- 网站网页栅格化
- 如何在自己新建的网页上加上图标 .ico文件
- 移动开发_iOS开发之@(),@[],@{}_软件世界网
- 僵尸进程与孤儿进程学习
- 输入层数打印金字塔
- 抢票助手-for 12306买火车票.订票助手.高铁.动车.春运.车票管家.自动刷票.列车时刻表
- 转技巧
- HBase源码解析(一) HMaster启动流程