As you can imagine, the fingerprint recognition in IOS 8 is handy, with just one interface, and a modal box popping up on the screen, just like the App Store.
Directly on the code, the following code is copied from Apple's official documentation.
Need to add Localauthentication.framework library, note that only the real machine has this library, the simulator does not
#import "Localauthentication/lacontext.h" lacontext *mycontext = [[Lacontext alloc] init]; Nserror *autherror = nil; NSString *mylocalizedreasonstring = @ "Please enter fingerprint"; if ([Mycontext canevaluatepolicy:lapolicydeviceownerauthenticationwithbiometrics Error:&autherror]) {[MyContex T Evaluatepolicy:lapolicydeviceownerauthenticationwithbiometrics localizedreason:mylocalizedreasonstring reply:^ (BOOL success, Nserror *error) {if (success) { User authenticated successfully, take appropriate action} ELS e {//User did not authenticate successfully, look at error and take appropriate actio n}}]; } else {//Could not evaluate policy, look at Autherror and present a appropriate message to user}
Effect: Myaddressbook is the name of my app, "Please enter a fingerprint" is a string in the code
It's still very simple.