99偷拍视频精品区一区二,口述久久久久久久久久久久,国产精品夫妇激情啪发布,成人永久免费网站在线观看,国产精品高清免费在线,青青草在线观看视频观看,久久久久久国产一区,天天婷婷久久18禁,日韩动漫av在线播放直播

iOSTouchID指紋識別技術簡介-創新互聯

Touch ID簡介:

創新互聯公司主營汝州網站建設的網絡公司,主營網站建設方案,重慶APP開發,汝州h5重慶小程序開發搭建,汝州網站營銷推廣歡迎汝州等地區企業咨詢

蘋果公司在iPhone 5S手機中推出了指紋識別功能,提高手機安全性的同時也方便了用戶操作。其功能是通過Touch ID實現的,從iOS 8系統開始,蘋果開發一些Touch ID的API使得開發人員可以在自己的應用程序中調用指紋識別功能。

Touch ID功能就是指紋識別密碼。使用指紋識別功能需要先進入設置—Touch ID 與密碼中根據提示添加指紋。

從iOS 8系統開始開放了Touch ID的驗證接口功能,在應用程序中可以判斷輸入的Touch ID是否設置持有者的Touch ID。

Touch ID使用:

創建一個iOS工程項目。         

打開工程的General — Linked Frameworks and Libraries面板,單機“+”按鈕添加“LocalAuthentication.framework”框架,如圖26-1所示。

編寫程序時導入“LocalAuthentication.framework”框架的頭文件:

#import <LocalAuthentication/LocalAuthentication.h>。

寫了一個簡單的測試Touch ID的例子,效果圖如下:(若圖片不清楚可右鍵將圖片保存本地再放大看)

iOS Touch ID指紋識別技術簡介

下面貼上代碼:

#import <UIKit/UIKit.h>
 
@interface HWTouchIDTestVC : UIViewController
 
@end
 
 
#import "HWTouchIDTestVC.h"
#import <LocalAuthentication/LocalAuthentication.h>
 
@interface HWTouchIDTestVC ()
 
@property (nonatomic, weak) UILabel *label;
 
@end
 
@implementation HWTouchIDTestVC
 
- (void)viewDidLoad {
 [super viewDidLoad];
 
 self.view.backgroundColor = [UIColor blackColor];
 
 //創建控件
 [self creatControl];
}
 
- (void)creatControl
{
 //測試按鈕
 UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(50, 200, 120, 50)];
 btn.backgroundColor = [UIColor orangeColor];
 [btn setTitle:@"測試按鈕" forState:UIControlStateNormal];
 [btn addTarget:self action:@selector(btnOnClick) forControlEvents:UIControlEventTouchUpInside];
 [self.view addSubview:btn];
 
 //提示標簽
 UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(220, 200, 120, 50)];
 label.text = @"測試標簽";
 label.textAlignment = NSTextAlignmentCenter;
 label.backgroundColor = [UIColor yellowColor];
 [self.view addSubview:label];
 self.label = label;
}
 
- (void)btnOnClick
{
 //初始化
 LAContext *context = [[LAContext alloc] init];
 NSError *error = nil;
 //顯示的文字
 NSString *str = @"指紋驗證";
 //判斷是否能進行驗證
 if ([context canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:&error]) {
 [context evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics localizedReason:str reply:^(BOOL success, NSError * _Nullable error) {
 
 if (success) {
 NSLog(@"驗證成功");
 dispatch_async(dispatch_get_main_queue(), ^{
  self.label.text = @"驗證成功";
  self.label.backgroundColor = [UIColor greenColor];
 });
 
 }else {
 NSLog(@"驗證失敗,error:%@", error);
 dispatch_async(dispatch_get_main_queue(), ^{
  self.label.text = @"驗證失敗";
  self.label.backgroundColor = [UIColor redColor];
 });
 }
 }];
 
 }else {
 NSLog(@"無法驗證指紋,error: %@", error);
 self.label.text = @"無法驗證";
 }
}
 
@end

另外有需要云服務器可以了解下創新互聯建站www.yijiale78.com,海內外云服務器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務器、裸金屬服務器、高防服務器、香港服務器、美國服務器、虛擬主機、免備案服務器”等云主機租用服務以及企業上云的綜合解決方案,具有“安全穩定、簡單易用、服務可用性高、性價比高”等特點與優勢,專為企業上云打造定制,能夠滿足用戶豐富、多元化的應用場景需求。

分享題目:iOSTouchID指紋識別技術簡介-創新互聯
本文網址:http://www.yijiale78.com/article10/phhdo.html

成都網站建設公司_創新互聯,為您提供網站內鏈網頁設計公司微信公眾號全網營銷推廣網站改版服務器托管

廣告

聲明:本網站發布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創新互聯

h5響應式網站建設