To run the example project, clone the repo, and run pod install
from the Example directory first.
- Simple View
- Lightweight Code
- Easy to use in replacement for UIView
- IBDesignable and IBInspectable properties
- Customization options
PasscodeField is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "PasscodeField"
Simply drag a UIView reference onto your storyboard where you would like it to go. Then set your custom class to PasscodeField
and your set. If you would like you can then configure some of the IBInspectable properties via the storyboard attributes editor (or do it in code!). Next you will want to create an IBOutlet for your PasscodeField
instance.
self.passcodeField.progress = passcodeText.characters.count
Here your just gonna do a frame init, configure, add the subview and your good to go!
let passcodeField = PasscodeField(frame: CGRectMake(100, 100, 300, 40))
passcodeField.progress = 0
// customize options
//
// passcodeField.length = 12
// passcodeField.fillColor = UIColor.redColor()
// passcode length.
var length: Int = 6
// current progress.
var progress: Int = 0 {
// height size of line.
var borderHeight: CGFloat = 2.0
// circle fill color.
var fillColor: UIColor = UIColor.blackColor()
// size of circle and line.
var fillSize: CGFloat = 20
Got a great idea and want to contribute? Here's how you can help...
- Fork it
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request
Ryota Tomomura (@famtom0518)
PasscodeField is available under the MIT license. See the LICENSE file for more info.