TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Sep 2016 |
SPMSupports SPM | ✗ |
Maintained by Siavash Alipour.
Simple and easy to use default iOS PIN screen. This simple library allows you to draw a fully customisable PIN screen same as the iOS default PIN view.
My inspiration to create this library was form THPinViewController, however SAPinViewController
is completely implemented in Swift
. Also the main purpose of creating this library was to have simple, easy to use and fully customisable PIN screen.
// 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
}
}
With Logo:
iPhone 4
iPhone 5
iPhone 6
iPhone 6 plus
iPad landscape
iPad portrait
To run the example project, clone the repo, and run pod install
from the Example directory first.
SAPinViewController is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "SAPinViewController"
Siavash, [email protected]
SAPinViewController is available under the MIT license. See the LICENSE file for more info.
If you have any feature requests or bug-fixes feel free to create an issue or send a pull request.