测试已测试 | ✗ |
语言语言 | SwiftSwift |
许可证 | MIT |
发布最后发布 | 2016年9月 |
SPM支持 SPM | ✗ |
维护者 Siavash Alipour。
简单易用的默认 iOS PIN 屏幕。这个简单的库使您能够绘制出一个完全可定制的 PIN 屏幕,类似于 iOS 默认的 PIN 视图。创建这个库的灵感来自 THPinViewController,但是 SAPinViewController
完全是用 Swift
实现的。此外,创建这个库的主要目的是有简单、易用且完全可定制的 PIN 屏幕。
// initial a "SAPinViewController" via the designate initialiser
let pinVC = SAPinViewController(withDelegate: self, backgroundImage: UIImage(named: "bg3"))
// setup different properties
pinVC.subtitleText = "Your passcode is required to enable Touch ID"
pinVC.buttonBorderColor = UIColor.whiteColor()
pinVC.alphabetColor = UIColor.whiteColor()
pinVC.showAlphabet = true // default is true
// ... and other properties
// present it
presentViewController(pinVC, animated: true, completion: nil)
// implement delegate methods
extension ViewController: SAPinViewControllerDelegate {
func pinEntryWasCancelled() {
dismissViewControllerAnimated(true, completion: nil)
}
func pinEntryWasSuccessful() {
dismissViewControllerAnimated(true, completion: nil)
}
func pinWasIncorrect() {
}
func isPinValid(pin: String) -> Bool {
return pin == pinString
}
}
带有标志
iPhone 4
iPhone 5
iPhone 6
iPhone 6 plus
iPad 横屏
iPad 竖屏
要运行示例项目,请克隆仓库,然后首先从 Example 目录运行 pod install
SAPinViewController 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile
pod "SAPinViewController"
Siavash, [email protected]
SAPinViewController 在 MIT 许可许可下提供。有关更多信息,请参阅 LICENSE 文件。
如果您有任何特性请求或错误修复,请随意创建问题或提交拉取请求。