A customizable verification code textField. Can be used for phone verification codes, passwords etc.
To run the example project, clone the repo, and run pod install
from the Example directory first.
- iOS 8.0+
KKPinCodeTextField is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'KKPinCodeTextField'
- Interface Builder:
Add a UITextView
in your Interface Builder and change the class of a textView from UITextView
to KKPinCodeTextView
. You can set the properties in the Attributes Inspector and see a live preview
- Programmatically:
KKPinCodeTextField *textField = [[KKPinCodeTextField alloc] initWithFrame:frame];
[self.view addSubview:textField];
Property | Type | Description | Default value |
---|---|---|---|
digitsCount |
NSUInteger | Verification code length | 4 |
borderHeight |
CGFloat | Bottom borders height | 4 |
bordersSpacing |
CGFloat | Spacing between bottom borders | 10 |
filledDigitBorderColor |
UIColor | Bottom border color when digit is filled | UIColor.lightGrayColor |
emptyDigitBorderColor |
UIColor | Bottom border color when digit is empty | UIColor.redColor |
If you have a question, find a bug, or just want to say hi, please open an issue on GitHub
KKPinCodeTextField
is available under the MIT License. See the LICENSE file for more info.