Giter Site home page Giter Site logo

chu888chu888 / ios-pcgestureunlock Goto Github PK

View Code? Open in Web Editor NEW

This project forked from iosdeveloperpanc/pcgestureunlock

0.0 0.0 0.0 10.06 MB

目前最全面最高仿支付宝的手势解锁,而且提供方法进行参数修改,能解决项目开发中所有手势解锁的开发

Objective-C 100.00%

ios-pcgestureunlock's Introduction

PCGestureUnlock

=================== ###目前最全面最高仿支付宝的手势解锁,而且提供方法进行参数修改,能解决项目开发中所有手势解锁的开发

宣言:不仅仅是支付宝手势解锁,它很好很强大~

框架基础:全面实现支付宝手势解锁,包括各种细节!!!(具体见gif图片)

框架目标:打造主流手势解锁终结者,简单易用,高度解耦!

框架特点:面向实际项目开发,修改参数(PCCircleViewConst.h文件中)即可实现实际需求

###设置密码:

ABC

###细节处理之全方向箭头

ABC

###细节处理之错误绘制

ABC

###细节处理之跳跃连线

ABC

###框架使用说明: 使用前说明: 解锁界面(PCCircleView)可以实例化出特定使用的类型界面,实现以下方法即可 // 初始化方法(设置view的相关类型、参数) - (instancetype)initWithType:(CircleViewType)type clip:(BOOL)clip arrow:(BOOL)arrow; clip代表圆内是否剪切 arrow代表是否有三角箭头

###1.包含框架文件:(FrameWork) ###2.在使用到的控制器中实现以下方法: - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view.

 // 解锁界面  默认clip:YES, arrow:YES
 PCCircleView *lockView = [[PCCircleView alloc] init];  
  lockView.delegate = self;
  self.lockView = lockView;
  [self.view addSubview:lockView];
 }

  #pragma - mark - circleView - delegate
  #pragma mark - circleView - delegate - setting
  - (void)circleView:(PCCircleView *)view type:(CircleViewType)type connectCirclesLessThanNeedWithGesture:(NSString *)gesture
{
 NSString *gestureOne = [PCCircleViewConst getGestureWithKey:gestureOneSaveKey];

  // 看是否存在第一个密码
 if ([gestureOne length]) {
     NSLog(@"提示再次绘制之前绘制的第一个手势密码");
 } else {
     NSLog(@"密码长度不合法%@", gesture);
 }
 }

  - (void)circleView:(PCCircleView *)view type:(CircleViewType)type didCompleteSetFirstGesture:(NSString *)gesture
{
   NSLog(@"获得第一个手势密码%@", gesture);
   // infoView展示对应选中的圆
}

- (void)circleView:(PCCircleView *)view type:(CircleViewType)type didCompleteSetSecondGesture:(NSString *)gesture result:(BOOL)equal
{
 NSLog(@"获得第二个手势密码%@",gesture);
 if (equal) {
     NSLog(@"两次手势匹配!可以进行本地化保存了");
  
 } else {
     NSLog(@"两次手势不匹配!");
 }
  }

#pragma mark - circleView - delegate - login or verify gesture
  - (void)circleView:(PCCircleView *)view type:(CircleViewType)type didCompleteLoginGesture:(NSString *)gesture result:(BOOL)equal
{
    // 此时的type有两种情况 Login or verify
    if (type == CircleViewTypeLogin) {
       if (equal) {
         NSLog(@"登陆成功!");
       } else {
        NSLog(@"密码错误!");
       }
 } else if (type == CircleViewTypeVerify) {
     
       if (equal) {
           NSLog(@"验证成功,跳转到设置手势界面");
           
       } else {
         NSLog(@"原手势密码输入错误!");
           
    }
    }
}

#PCGestureUnlock 手势解锁终结者

###作品说明:由科匠***武汉公司ios工程师PC制作 ###作品时间:2015年6月9日 ###联系QQ:505433196(请注明缘由) ###开发QQ群:30611628

ios-pcgestureunlock's People

Contributors

yangtzepanc avatar iosdeveloperpanc 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.