服务器之家

服务器之家 > 正文

iOS指纹识别的简单应用

时间:2021-06-03 15:36     来源/作者:青灯古魔

指纹识别(touch id)的简单应用,供大家参考,具体内容如下

1、调用

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
- (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

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持服务器之家。

原文链接:https://blog.csdn.net/qq_15289761/article/details/107013917

标签:

相关文章

热门资讯

2020微信伤感网名听哭了 让对方看到心疼的伤感网名大全
2020微信伤感网名听哭了 让对方看到心疼的伤感网名大全 2019-12-26
yue是什么意思 网络流行语yue了是什么梗
yue是什么意思 网络流行语yue了是什么梗 2020-10-11
背刺什么意思 网络词语背刺是什么梗
背刺什么意思 网络词语背刺是什么梗 2020-05-22
苹果12mini价格表官网报价 iPhone12mini全版本价格汇总
苹果12mini价格表官网报价 iPhone12mini全版本价格汇总 2020-11-13
2021德云社封箱演出完整版 2021年德云社封箱演出在线看
2021德云社封箱演出完整版 2021年德云社封箱演出在线看 2021-03-15
返回顶部