First import the Localauthentication framework
Then import the header file
#import <LocalAuthentication/LAPublicDefines.h>
-(void) beginauthentication{lacontext *context = [[Lacontext alloc] init]; Nserror *eror = nil; NSString *reson = @ "fingerprint identification"; if ([Context Canevaluatepolicy:lapolicydeviceownerauthenticationwithbiometrics Error:&eror]) {//Support fingerprint identification [context Evaluatepolicy:lapolicydeviceownerauthenticationwithbiometrics Localizedreason:reson reply:^ (BOOL success, NSError * _nullable error) {if (success) {//Fingerprint verification succeeded NSLog (@ "identify success"); }else{//Specific Erro.code error description in LAError.h header file switch (error.code) {case LAEr roruserfallback://User Select Enter password NSLog (@ "Enter password"); Break Case laerrortouchidlockout://User Multiple validation failed NSLog (@ "multiple errors"); Default:nslog (@ "ErrorCode = =%@", error); Break } } }]; }else{//does not support fingerprint identification NSLog (@ "%@", eror); }}
Simple use of IOS fingerprint recognition