KOPinCodeView is a completed view developed for PIN-code entering.
Key features and advantages:
- easy for integrating in controller;
- wide visual customization;
- automatically creates TextField and background view according to self view;
- optional PIN-code confirmation with integrated permission control;
- able to set number of cells for PIN-code entering.
KOPinCodeView is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "KOPinCodeView"
#import <KOPinCodeView/KOPinCodeView.h> //in your controller's header file
If you are using use_frameworks!
in your Podfile, use this import:
import KOPinCodeView
//init PinCodeView with cout symbol
-(void)initPinWithCountView:(int)count;
//init PinCodeView with confirm or custom view
-(void)initPinViewWithConfirmPIN:(BOOL)confirm
countSymbol:(int)count
sizeSimbol:(CGSize)size
formView:(FormView)form;
// delegate method. Called when entered all simbols.
// it returned symbols array and string with all symbols.
- (void)pinDidEnterAllSymbol:(NSArray *)symbolArray string:(NSString*)pin;
//1. init with frame
KOPinCodeView *pinCodeView = [[KOPinCodeView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 65)];
//2. Add to you view
[self.view addSubview:pinCodeView];
//3. setting the delegate:
pinCodeView.delegate = self;
//or just add view in storyboard
//and init PinCodeView with cout symbol example
[pinCodeView initPinWithCountView:4];
[self.pinCodeConfirmView initPinViewWithConfirmPIN:YES countSymbol:6 sizeSimbol:CGSizeMake(45, 45) formView:kCircle];
//thickness view line
self.pinCodeConfirmView.lineDeep = 2.f;
//Color view line
self.pinCodeConfirmView.lineColor = kColor;
//Background color view in select state
self.pinCodeConfirmView.selectColor = [kColor colorWithAlphaComponent:0.5f];
//Text color UITextField
self.pinCodeConfirmView.symbolColor = kColor;
//Font UITextField
self.pinCodeConfirmView.symbolFont = [UIFont systemFontOfSize:14];
//UILabel show only initPinViewWithConfirmPIN:
//Text color Label
self.pinCodeConfirmView.titleColor = kColor;
//Font Label
self.pinCodeConfirmView.titleFont = [UIFont systemFontOfSize:14];
//Text Label - Default: "enter Pin code"
self.pinCodeConfirmView.enterPinString = @"Any text 1";
//Text Label - Default: "Confirm Pin code"
self.pinCodeConfirmView.confirmPinString = @"Any text 2";
//Create Confirm Pin Code
self.pinCodeConfirmView.confirm = NO;
//Secure Text - Default: YES
self.pinCodeConfirmView.secure = NO;
//Keyboard Type
self.pinCodeConfirmView.typeKeyboard = UIKeyboardTypeNumberPad;
Oleksandr Khymych, [email protected]
KOPinCodeView is available under the MIT license. See the LICENSE file for more info.