Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/siavashalipour/SAPinViewController
A Swifty iOS PIN Screen
https://github.com/siavashalipour/SAPinViewController
Last synced: about 1 month ago
JSON representation
A Swifty iOS PIN Screen
- Host: GitHub
- URL: https://github.com/siavashalipour/SAPinViewController
- Owner: siavashalipour
- License: mit
- Created: 2016-08-21T12:21:29.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-12-09T22:21:18.000Z (about 6 years ago)
- Last Synced: 2024-04-23T19:19:44.869Z (9 months ago)
- Language: Swift
- Homepage:
- Size: 5.11 MB
- Stars: 20
- Watchers: 3
- Forks: 9
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ios - SAPinViewController - 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. (Security / Unofficial)
- awesome-ios-star - SAPinViewController - 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. (Security / Unofficial)
README
# SAPinViewController
[![Build Status](https://travis-ci.org/siavashalipour/SAPinViewController.svg)](https://travis-ci.org/siavashalipour/SAPinViewController)
[![Version](https://img.shields.io/cocoapods/v/SAPinViewController.svg?style=flat)](http://cocoapods.org/pods/SAPinViewController)
[![License](https://img.shields.io/cocoapods/l/SAPinViewController.svg?style=flat)](http://cocoapods.org/pods/SAPinViewController)
[![Platform](https://img.shields.io/cocoapods/p/SAPinViewController.svg?style=flat)](http://cocoapods.org/pods/SAPinViewController)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](https://github.com/antiraum/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.
## Features
- Support both iPhone and iPad landscape/portrait
- Designed with the help of [SnapKit](https://github.com/SnapKit/SnapKit)
- Fully customisable:
- change title font/colour
- change subtitle font/colour
- change numbers font/colour
- change alphabet font/color
- change numbers boundary colour
- change PIN dots color
- add solid background colour
- add custom image as background and gets blurred automatically
- hide alphabets
- change cancel button font/colour
- ###### NEW in 0.1.2:
- now you can have your logo on top as well
- now you can have rounded rect as well as circle type UI
## Usage
```swift
// 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
}
}
```
## Screenshots
With Logo:iPhone 4
iPhone 5
iPhone 6
iPhone 6 plus
iPad landscape
iPad portrait
## Example
To run the example project, clone the repo, and run `pod install` from the Example directory first.
## Requirements
- Minimum iOS 8## Installation
SAPinViewController is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:```ruby
pod "SAPinViewController"
```## Author
Siavash, [email protected]
## License
SAPinViewController is available under the MIT license. See the LICENSE file for more info.
## Contribution
If you have any feature requests or bug-fixes feel free to create an issue or send a pull request.