南宁网站推广排名,南通网站推广优化费用,深圳分销网站设计制作,wordpress代码编辑器件file:///Users/OWen/Desktop/3DTouch.png 随着iOS系统不断的更新迭代#xff0c;苹果总会推出一些新的功能#xff0c;今天就研究了一下iOS8之后推出的指纹验证的功能#xff0c;然后写了一个小demo#xff0c;与君分享。。 上demo#xff1a; 1#xff1a;首先导入一个…file:///Users/OWen/Desktop/3DTouch.png 随着iOS系统不断的更新迭代苹果总会推出一些新的功能今天就研究了一下iOS8之后推出的指纹验证的功能然后写了一个小demo与君分享。。 上demo 1首先导入一个系统的库文件 #import LocalAuthentication/LocalAuthentication.h 2 LAContext *mycontent [[LAContext alloc] init]; NSString *myLocalizedReasonString 小伙子,请输入你的指纹; NSError *authError nil; if ([mycontent canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:authError]) { [mycontent evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics localizedReason:myLocalizedReasonString reply:^(BOOL success, NSError *error) { if (success) { // User authenticated successfully, take appropriate action } else { NSLog(-----%,error); // User did not authenticate successfully, look at error and take appropriate action } }]; } else { // Could not evaluate policy; look at authError and present an appropriate message to user } 注意测试神马的还得在真机上调试。转载于:https://www.cnblogs.com/110-913-1025/p/5566353.html