View like iOS7 Lock screen
Dinamic count of input numbers and custom configuration, works on iOS 5 and above
-
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];
- Image author MsLarkina
- First version kosyloa
- Custom configutation busta117
- user can set his pass ihomam
PinPad is provided under the MIT license.