当前位置: 移动技术网 > IT编程>移动开发>IOS > iOS指纹识别的简单应用

iOS指纹识别的简单应用

2020年08月17日  | 移动技术网IT编程  | 我要评论
指纹识别(touch id)的简单应用,供大家参考,具体内容如下1、调用- (void)viewdidload { [super viewdidload]; // do any additional

指纹识别(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];
}

具体demo

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持移动技术网。

如您对本文有疑问或者有任何想说的,请 点击进行留言回复,万千网友为您解惑!

相关文章:

验证码:
移动技术网