All Projects → pujiaxin33 → Jxpatternlock

pujiaxin33 / Jxpatternlock

Licence: mit
An easy-to-use, powerful, customizable pattern lock view in swift. 图形解锁/手势解锁 / 手势密码 / 图案密码 / 九宫格密码

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Jxpatternlock

Gesture recognition
a gesture recognition verification lock
Stars: ✭ 37 (-77.58%)
Mutual labels:  password, gesture
Patternlocker
Android 图形解锁/手势解锁 / 手势密码 / 图案密码 / 九宫格密码
Stars: ✭ 409 (+147.88%)
Mutual labels:  pattern, gesture
React Locky
"🔒-y" – Asgardian God of Event Scoping 📦, Scroll Locking 📜, Silence Casting 🙊
Stars: ✭ 141 (-14.55%)
Mutual labels:  lock
Inboxrecyclerview
Build expandable descendant navigation, inspired by Google Inbox
Stars: ✭ 1,953 (+1083.64%)
Mutual labels:  gesture
Ruby Possibly
A maybe monad
Stars: ✭ 149 (-9.7%)
Mutual labels:  pattern
Imageviewer
A simple and customizable Android full-screen image viewer 一个简单且可自定义的Android全屏图像浏览器
Stars: ✭ 1,889 (+1044.85%)
Mutual labels:  gesture
Ng
Get password of the wifi you're connected, and your current ip address.
Stars: ✭ 151 (-8.48%)
Mutual labels:  password
Swipeback
SwipeBack is an android library that can finish a activity by using gesture.
Stars: ✭ 1,717 (+940.61%)
Mutual labels:  gesture
Passw0rd
🔑securely checks a password to see if it has been previously exposed in a data breach
Stars: ✭ 159 (-3.64%)
Mutual labels:  password
Dontclickshit
Як не стати кібер-жертвою
Stars: ✭ 149 (-9.7%)
Mutual labels:  password
Lock Threads
GitHub Action that locks closed issues and pull requests after a period of inactivity
Stars: ✭ 156 (-5.45%)
Mutual labels:  lock
Is my password pwned
How often does your password appear in the Pwned Passwords database? Uses the k-anonymity API.
Stars: ✭ 148 (-10.3%)
Mutual labels:  password
Algorithm Pattern
算法模板,最科学的刷题方式,最快速的刷题路径,你值得拥有~
Stars: ✭ 12,970 (+7760.61%)
Mutual labels:  pattern
Karma
Find leaked emails with your passwords
Stars: ✭ 154 (-6.67%)
Mutual labels:  password
Lockdemo
指纹识别、图形识别、aliOCR识别
Stars: ✭ 142 (-13.94%)
Mutual labels:  pattern
Wifi Passview
An open source batch script based WiFi Passview for Windows!
Stars: ✭ 157 (-4.85%)
Mutual labels:  password
Node Proper Lockfile
An inter-process and inter-machine lockfile utility that works on a local or network file system.
Stars: ✭ 139 (-15.76%)
Mutual labels:  lock
Designpatternsincsharp
Samples associated with Pluralsight design patterns in c# courses.
Stars: ✭ 149 (-9.7%)
Mutual labels:  pattern
Randomatic
Easily generate random strings like passwords, with simple options for specifying a length and for using patterns of numeric, alpha-numeric, alphabetical, special or custom characters. (the original "generate-password")
Stars: ✭ 149 (-9.7%)
Mutual labels:  password
Pinedittextfield
Android library for pin edit text
Stars: ✭ 164 (-0.61%)
Mutual labels:  password

platform languages cocoapods carthage support

An easy-to-use, powerful, customizable pattern lock view in swift. 图形解锁/手势解锁 / 手势密码 / 图案密码 / 九宫格密码

相比于其他同类三方库有哪些优势:

  • 完全面对协议编程,支持高度自定义网格视图连接线视图,轻松实现各类不同需求;
  • 默认支持多种配置效果,支持大部分主流效果,引入就可以搞定需求;
  • 源码采用Swift5编写,通过泛型、枚举、函数式编程优化代码,具有更高的学习价值;
  • 后期会持续迭代,不断添加主流效果;

效果预览

说明 Gif
箭头
中间点自动连接
小灰点
小白点
荧光蓝
fill白色
阴影
图片
旋转(鸡你太美)
破折线
图片连接线(箭头)
图片连接线(小鱼儿)
设置密码
修改密码
验证密码

要求

  • iOS 9.0+
  • Xcode 10.2.1+
  • Swift 5.0

安装

手动

Clone代码,把Sources文件夹拖入项目,就可以使用了;

CocoaPods

target '<Your Target Name>' do
    pod 'JXPatternLock'
end

先执行pod repo update,再执行pod install

Carthage

在cartfile文件添加:

github "pujiaxin33/JXPatternLock"

然后执行carthage update --platform iOS 即可

使用

初始化PatternLockViewConfig

方式一:使用LockConfig

LockConfig是默认提供的类,实现了PatternLockViewConfig协议。可以直接通过LockConfig的属性进行自定义。

let config = LockConfig()
config.gridSize = CGSize(width: 70, height: 70)
config.matrix = Matrix(row: 3, column: 3)
config.errorDisplayDuration = 1

方式二:新建实现PatternLockViewConfig协议的类

该方式可以将所有配置细节聚集到自定义类的内部,外部只需要初始化自定义类即可。详情请参考demo里面的ArrowConfig类。这样有个好处就是,多个地方都需要用到同样配置的时候,只需要初始化相同的类,而不用像使用LockConfig那样,复制属性配置代码。

struct ArrowConfig: PatternLockViewConfig {
    var matrix: Matrix = Matrix(row: 3, column: 3)
    var gridSize: CGSize = CGSize(width: 70, height: 70)
    var connectLine: ConnectLine?
    var autoMediumGridsConnect: Bool = false
    //其他属性配置!只是示例,就不显示所有配置项,影响文档长度
}

配置GridView

config.initGridClosure = {(matrix) -> PatternLockGrid in
    let gridView = GridView()
    let outerStrokeLineWidthStatus = GridPropertyStatus<CGFloat>.init(normal: 1, connect: 2, error: 2)
    let outerStrokeColorStatus = GridPropertyStatus<UIColor>(normal: tintColor, connect: tintColor, error: .red)
    gridView.outerRoundConfig = RoundConfig(radius: 33, lineWidthStatus: outerStrokeLineWidthStatus, lineColorStatus: outerStrokeColorStatus, fillColorStatus: nil)
    let innerFillColorStatus = GridPropertyStatus<UIColor>(normal: nil, connect: tintColor, error: .red)
    gridView.innerRoundConfig = RoundConfig(radius: 10, lineWidthStatus: nil, lineColorStatus: nil, fillColorStatus: innerFillColorStatus)
    return gridView
}

配置ConnectLine

let lineView = ConnectLineView()
lineView.lineColorStatus = .init(normal: tintColor, error: .red)
lineView.triangleColorStatus = .init(normal: tintColor, error: .red)
lineView.isTriangleHidden = false
lineView.lineWidth = 3
config.connectLine = lineView

初始化PatternLockView

lockView = PatternLockView(config: config)
lockView.delegate = self
view.addSubview(lockView)

结构

structure

完全遵从面对协议开发。 PatternLockView依赖于配置协议PatternLockViewConfigPatternLockViewConfig依赖配置网格协议PatternLockGrid和连接线协议ConnectLine

补充

如果刚开始使用JXPatternLock,当开发过程中需要支持某种特性时,请务必先搜索使用文档或者源代码。确认是否已经实现支持了想要的特性。请别不要文档和源代码都没有看,就直接提问,这对于大家都是一种时间浪费。如果没有支持想要的特性,欢迎提Issue讨论,或者自己实现提一个PullRequest。

使用过程中,有任何建议或问题,可以通过以下方式联系我: 邮箱:[email protected]

喜欢就star❤️一下吧

License

JXPatternLock is released under the MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].