Latest 0.0.1
Homepage https://github.com/BeckWang0912/TDGesturePassword
License MIT
Platforms ios 8.0, requires ARC
Dependencies Kingfisher
Authors

手势密码管理

==== 详细用法请下载demo调试

==== 个性化配置

    // 个性化配置(没有配置的取默认值,今后也可以随时扩展),每次调用TDPHandGestureService.standard()中的方法前都可以重新配置
    func configLockManager(_ imageUrl: String,
                           _ passwordKeySuffix: String,
                           _ selectedColor: UIColor,
                           _ barTintColor: UIColor,
                           _ barTittleColor: UIColor,
                           _ warningTitleColor: UIColor)

==== 设置手势密码

    // 设置手势密码
    func settingLockGestrue(fromViewController: UIViewController, completeHandle:@escaping (() -> Void))

    // 设置手势密码闭包回调
    var settingGesturePwdClosure: ((_ viewCtrl: UIViewController) -> Void)?

==== 修改手势密码

    // 修改手势密码
    func modifyLockController(fromViewController: UIViewController,completeHandle:@escaping (() -> Void))

==== 验证手势密码

    // 验证手势密码
    func vertifyHandGesturePassword(viewController: UIViewController) 

==== 打开手势

    // 打开手势
    func openHandGesture(fromViewController: UIViewController, completeHandle:@escaping ((_ isOpen:Bool) -> Void))

==== 关闭手势

    // 关闭手势
    func closeHandGesture(fromViewController: UIViewController, completeHandle:@escaping ((_ isOpen:Bool) -> Void)) 

=== 注册&销毁手势密码

    // 注册成功后调用
    //  主要是存储当前用户的手势 (key 为 token)
    //  注意: 注册流程是手势设置成功后才注册,所以fulltelno是在之后才能获得,这里会从默认手势密码那里来获取设置的手势值重新设置到对应的用户.
    func setupHandGestureWhenRegister() {
        LockManager.options.passwordKeySuffix = "用户自定义唯一后缀"
        var password = LockManager.storage.str(forKey: PASSWORD_KEY + LockManager.options.passwordKeySuffix)
        if password == nil || password?.characters.count == 0 {
            password = LockManager.storage.str(forKey: PASSWORD_KEY) ?? ""
            LockManager.storage.setStr(password!, key: PASSWORD_KEY + LockManager.options.passwordKeySuffix)
        }
        LockManager.openGesture()
    }

    // 注销用户调用
    // 主要是删除当前用户手势 (key 为 token)
    // 这里不做处理 不需要删除用户手势
    func removeHandGestureWhenLogout() {
        LockManager.options.passwordKeySuffix = "用户自定义唯一后缀"
        LockManager.storage.removeValue(forKey: PASSWORD_KEY + LockManager.options.passwordKeySuffix)
        LockManager.storage.removeValue(forKey: OPEN_KEY + LockManager.options.passwordKeySuffix)
    }

Latest podspec

{
    "name": "TDGesturePassword",
    "version": "0.0.1",
    "summary": "Simplely to Use TDGesturePassword.",
    "homepage": "https://github.com/BeckWang0912/TDGesturePassword",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "description": "TDGesturePassword u662fu4e00u4e2au7528u4e8eu5b9eu73b0u624bu52bfu5bc6u7801u7ba1u7406u7684u5de5u5177",
    "authors": {
        "wang zhitao": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/BeckWang0912/TDGesturePassword.git",
        "tag": "0.0.1"
    },
    "requires_arc": true,
    "dependencies": {
        "Kingfisher": []
    },
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This