Giter Club home page Giter Club logo

passcodelock's Introduction

PasscodeLock

密码解锁 手势解锁 指纹解锁

1.手势解锁

demo

使用方法

MYZGestureView * gestureView = [[MYZGestureView alloc] init];
gestureView.gestureResult = ^(NSString * gestureCode){
  //得到手势密码 gestureCode 
};

2.密码解锁

demo

使用方法

MYZPasscodeView * passcodeView = [[MYZPasscodeView alloc] init];
passcodeView.PasscodeResult = ^(NSString * passcode){
   //得到数字密码passcode
};

3.指纹解锁

demo

#import <LocalAuthentication/LocalAuthentication.h>

//判断是否支持指纹识别
if ([UIDevice currentDevice].systemVersion.floatValue >= 8.0)
{
    //本地验证对象上下文
    LAContext *context = [LAContext new];

    //LAPolicyDeviceOwnerAuthenticationWithBiometrics: 允许使用
    if ([context canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:nil]){
        
        //localizedReason: 指纹识别出现时的提示文字
        [context evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics localizedReason:@"指纹识别, 开锁" reply:^(BOOL success, NSError * _Nullable error) {

            if (success) {
                //识别成功
                dispatch_async(dispatch_get_main_queue(), ^{ 
                    //...
                });
            }

            if (error) { }
        }];
    }
}

passcodelock's People

Contributors

ma806p avatar

Watchers

James Cloos avatar Kevin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.