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