Skip to content

ugurcetinkaya/KOPinCodeView

 
 

Repository files navigation

Overview

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 KOPinCodeView

KOPinCodeView

Version License Platform

Installation

KOPinCodeView is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "KOPinCodeView"

Objective-C

#import <KOPinCodeView/KOPinCodeView.h> //in your controller's header file

Swift

If you are using use_frameworks! in your Podfile, use this import:

import KOPinCodeView

Usage

In Objective-C

Init methods

//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 methods KOPinCodeViewDelegate

// delegate method. Called when entered all simbols.
// it returned symbols array and string with all symbols.
- (void)pinDidEnterAllSymbol:(NSArray *)symbolArray string:(NSString*)pin;
Creating a Pin Code View
Example code:

//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];
init PinCodeView with confirm example:

[self.pinCodeConfirmView initPinViewWithConfirmPIN:YES countSymbol:6 sizeSimbol:CGSizeMake(45, 45) formView:kCircle];
Pin Code View with confirm custom settings example:

//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;

Author

Oleksandr Khymych, [email protected]

License

KOPinCodeView is available under the MIT license. See the LICENSE file for more info.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 55.5%
  • Shell 41.4%
  • Ruby 3.1%