大橙子网站建设,新征程启航
为企业提供网站建设、域名注册、服务器等服务
创新互联www.cdcxhl.cn八线动态BGP香港云服务器提供商,新人活动买多久送多久,划算不套路!
创新互联建站专注为客户提供全方位的互联网综合服务,包含不限于成都做网站、网站设计、海州网络推广、微信平台小程序开发、海州网络营销、海州企业策划、海州品牌公关、搜索引擎seo、人物专访、企业宣传片、企业代运营等,从售前售中售后,我们都将竭诚为您服务,您的肯定,是我们大的嘉奖;创新互联建站为所有大学生创业者提供海州建站搭建服务,24小时服务热线:028-86922220,官方网址:www.cdcxhl.com不懂如何实现iOS指纹识别应用?其实想解决这个问题也不难,下面让小编带着大家一起学习怎么去解决,希望大家阅读完这篇文章后大所收获。
指纹识别(Touch ID)的简单应用,供大家参考,具体内容如下
1、调用
- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. [self setupNotification]; UIButton *button = [[UIButton alloc]initWithFrame:CGRectMake(100, 100, 100, 100)]; [button setTitle:@"点击调用" forState:UIControlStateNormal]; [button addTarget:self action:@selector(actionDidClickButton:) forControlEvents:UIControlEventTouchUpInside]; [button setTitleColor:[UIColor orangeColor] forState:UIControlStateNormal]; [self.view addSubview:button]; } - (void)actionDidClickButton:(UIButton *)sender { [self touchIDTest]; } - (void)touchIDTest { [TouchIDManager validateTouchID]; } - (void)setupNotification { [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(actionDidReceiveValidateTouchIDSuccess) name:ValidateTouchIDSuccess object:nil]; [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(actionDidReceiveValidateTouchIDNotAvailable) name:ValidateTouchIDNotAvailable object:nil]; [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(actionDidReceiveValidateTouchIDNotEnrolled) name:ValidateTouchIDNotEnrolled object:nil]; [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(actionDidReceiveValidateTouchIDAuthenticationFailed) name:ValidateTouchIDAuthenticationFailed object:nil]; [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(actionDidReceiveValidateTouchIDCancel) name:ValidateTouchIDCancel object:nil]; [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(actionTouchIDLockout) name:ValidateTouchIDLockout object:nil]; } - (void)actionDidReceiveValidateTouchIDSuccess { NSLog(@"%s",__func__); } - (void)actionDidReceiveValidateTouchIDNotAvailable { NSLog(@"%s",__func__); } - (void)actionDidReceiveValidateTouchIDNotEnrolled { NSLog(@"%s",__func__); } - (void)actionDidReceiveValidateTouchIDAuthenticationFailed { NSLog(@"%s",__func__); } - (void)actionDidReceiveValidateTouchIDCancel { NSLog(@"%s",__func__); } - (void)actionTouchIDLockout { NSLog(@"%s",__func__); } - (void)dealloc { [[NSNotificationCenter defaultCenter]removeObserver:self]; }