Busta117 / PinPad

pin pad like iOS7 Lock screen

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PinPad

View like iOS7 Lock screen

Dinamic count of input numbers and custom configuration, works on iOS 5 and above

How to use

  • add the folder PinPad in your project folder

  • add #import "PPPinPadViewController.h" in your viewController(in the .h file)

  • implement the protocol PinPadPasswordProtocol in your class

  • this protocol have a simple methods to control the pin pad

      - (BOOL)checkPin:(NSString *)pin; 	//required, validation with your configured code
      - (NSInteger)pinLenght; 			//required, works like a data source of pin lenght
      - (void)pinPadSuccessPin;			//optional, when the user set a correct pin
      - (void)pinPadWillHide;				//optional, before the pin pad hide
      - (void)pinPadDidHide;				//optional, after pin pad hide
      - (void)userPassCode:(NSString *)newPassCode; //optional, set new user passcode
    
  • in your code setup the controller as shown below:

      PPPinPadViewController * pinViewController = [[PPPinPadViewController alloc] init];
      pinViewController.delegate = self;
      pinViewController.pinTitle = @"Enter Passcode";	    pinViewController.isSettingPinCode = YES; // YES-input new passcode and confirmation 
      pinViewController.errorTitle = @"Passcode is not correct";
      pinViewController.cancelButtonHidden = NO; //default is False
      pinViewController.backgroundImage = [UIImage imageNamed:@"pinViewImage"]; //if you need remove the background set a empty UIImage ([UIImage new]) or set a background color
      pinViewController.backgroundColor = [UIColor darkGrayColor]; //default is a darkGrayColor
      
      [self presentViewController:pinViewController animated:YES completion:NULL];
    

Credits

About

pin pad like iOS7 Lock screen


Languages

Language:Objective-C 100.0%