An essay on iOS 3D touch fingerprint Verification

Source: Internet
Author: User

File:///Users/OWen/Desktop/3DTouch.png

With the iOS system constantly updating iterations, Apple will always launch some new features, today to study the iOS8 after the introduction of the fingerprint verification function, and then wrote a small demo, share with June.

Demo:1: First import a system library file #import <LocalAuthentication/LocalAuthentication.h>

2:

Lacontext *mycontent = [[Lacontext alloc] init];

NSString *mylocalizedreasonstring = @ "Lad, please enter your fingerprint";

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 a appropriate message to user

}

Note that testing God's horse still has to be debugged on the real machine.

An essay on iOS 3D touch fingerprint Verification

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.