Latest 1.5.5
Homepage https://github.com/huangboju/GesturePassword
License MIT
Platforms ios 8.0, requires ARC
Frameworks UIKit
Authors

GesturePassword 是一个Swift的手势密码库

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

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

Cocoapods

pod 'GesturePassword'

1.设置密码

Alt text

AppLock.set(controller: self, success: { (controller) in
                    print(controller.title as Any)
                })

2.验证密码

Alt text

AppLock.verify(controller: self, success: { (controller) in
                    print("success", controller.title as Any)
                }, forget: { (controller) in
                    print("forget", controller.title as Any)
                }, overrunTimes: { (controller) in
                    print("overrunTimes", controller.title as Any)
                })

3.修改密码

Alt text

AppLock.modify(controller: self, success: { (controller) in
                    print("success")
                }, forget: { (controller) in
                    print("forget")
                })

Usage

  1. 将Lock.swift文件拖入你的工程
  2. 使用二次封装的AppLock类自己调用设置密码修改密码验证密码
    
    let AppLock = Lock.shared

class Lock {

static let shared = Lock()

private init() {
    // 在这里自定义你的UI
    var options = LockOptions()
    options.passwordKeySuffix = "test"
    options.usingKeychain = true
    options.circleLineSelectedCircleColor = options.circleLineSelectedColor
    options.lockLineColor = options.circleLineSelectedColor
}

func set(controller: UIViewController, success: controllerHandle? = nil) {
    if hasPassword {
        print("还没有密码")
    } else {
       LockManager.showSettingLockController(in: controller, success: success)
    }
}

func verify(controller: UIViewController, success: controllerHandle?, forget: controllerHandle?, overrunTimes: controllerHandle?) {
    if !hasPassword {
        print("没有密码")
    } else {
        LockManager.showVerifyLockController(in: controller, success: success, forget: forget, overrunTimes: overrunTimes)
    }

}

func modify(controller: UIViewController, success: controllerHandle?, forget: controllerHandle?) {
    if !hasPassword {
        print("没有密码")
    } else {
        LockManager.showModifyLockController(in: controller, success: success, forget: forget)
    }
}

var hasPassword: Bool {
    // 这里密码后缀可以自己传值,默认为上面设置的passwordKeySuffix
    return LockManager.hasPassword()
}

func removePassword() {
    // 这里密码后缀可以自己传值,默认为上面设置的passwordKeySuffix
    LockManager.removePassword()
}

}

Latest podspec

{
    "name": "GesturePassword",
    "version": "1.5.5",
    "summary": "GesturePassword is a simple gesture password written in Swift",
    "homepage": "https://github.com/huangboju/GesturePassword",
    "license": "MIT",
    "authors": {
        "huangboju": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/huangboju/GesturePassword.git",
        "tag": "1.5.5"
    },
    "source_files": "Classes/**/*.swift",
    "frameworks": "UIKit",
    "requires_arc": true,
    "pod_target_xcconfig": {
        "SWIFT_VERSION": "3.0"
    },
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This