您好,登錄后才能下訂單哦!
不懂如何實(shí)現(xiàn)iOS指紋識別應(yīng)用?其實(shí)想解決這個(gè)問題也不難,下面讓小編帶著大家一起學(xué)習(xí)怎么去解決,希望大家閱讀完這篇文章后大所收獲。
指紋識別(Touch ID)的簡單應(yīng)用,供大家參考,具體內(nèi)容如下
1、調(diào)用
- (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:@"點(diǎn)擊調(diào)用" 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]; }
感謝你能夠認(rèn)真閱讀完這篇文章,希望小編分享如何實(shí)現(xiàn)iOS指紋識別應(yīng)用內(nèi)容對大家有幫助,同時(shí)也希望大家多多支持億速云,關(guān)注億速云行業(yè)資訊頻道,遇到問題就找億速云,詳細(xì)的解決方法等著你來學(xué)習(xí)!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。