Giter Site home page Giter Site logo

gesturepassword's Introduction

GesturePassword 是一个Swift的手势密码库

是对CoreLock的翻译,在它的基础上进行了改进,优化。在此谢谢原著。

如果对你有帮助,Star一下吧!有任何问题请Issues,我会尽快修正

pod 'GesturePassword'

###1.设置密码 Alt text

import GesturePassword
var options = LockOptions()
        options.passwordKeySuffix = "xiAo_Ju" // 设置密码时最好设置一个后缀
LockManager.showSettingLockControllerIn(self, success: { (controller) in
                            
                        })

###2.验证密码 Alt text

import GesturePassword
LockManager.showVerifyLockControllerIn(self, forget: { (controller) in
                            print("forget")
                            }, success: { (controller) in
                                print("success")
                            }, overrunTimes: { (controller) in
                                print("overrunTimes")
                        })

###3.修改密码 Alt text

import GesturePassword
LockManager.showModifyLockControllerIn(self, success: { (controller) in
                            print("success")
                            }, forget: { (controller) in
                            print("forget")
                        })

###4.自定义 ######如果你只是需要自定义一点点东西,这样就好了

var options = LockOptions()
        options.passwordKeySuffix = "xiAo_Ju"
        options.arcLineWidht = 1

######5.如果你需要大量自定义

struct YourOptions: LockDataSource, LockDelegate {
    
    init() {}

    /// 选中圆大小比例
    var scale: CGFloat = 0.3 {
        willSet {
            LockManager.options.scale = newValue
        }
    }
 
    /// 选中圆大小的线宽
    var arcLineWidth: CGFloat = 1 {
        willSet {
            LockManager.options.arcLineWidth = newValue
        }
    }

    /// 密码后缀
    var passwordKeySuffix = "" {
        willSet {
            LockManager.options.passwordKeySuffix = newValue
        }
    }


    // MARK: - 设置密码

    /// 最低设置密码数目
    var settingTittle = "设置密码" {
        willSet {
            LockManager.options.settingTittle = newValue
        }
    }
}
  LockManager.options = YourOptions()

gesturepassword's People

Contributors

huangboju avatar

Watchers

Lerist avatar  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.