TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Dec 2014 |
Maintained by Unclaimed.
This project gives you a passcode control that can be dropped into any iOS app. It behaves exactly like the passcode screens that can be seen by going to Settings > General > Passcode Lock.
Here are some quick examples. To see them in use, open the "SampleApp" Xcode project.
GCPINViewController *PIN = [[GCPINViewController alloc]
initWithNibName:nil
bundle:nil
mode:GCPINViewControllerModeCreate];
PIN.messageText = @"Create Passcode";
PIN.errorText = @"The passcodes do not match";
PIN.verifyBlock = ^(NSString *code) {
NSLog(@"setting code: %@", code);
return YES;
};
[PIN presentFromViewController:self animated:YES];
[PIN release];
GCPINViewController *PIN = [[GCPINViewController alloc]
initWithNibName:nil
bundle:nil
mode:GCPINViewControllerModeVerify];
PIN.messageText = @"Check Passcode";
PIN.errorText = @"Incorrect passcode";
PIN.verifyBlock = ^(NSString *code) {
NSLog(@"checking code: %@", code);
return [code isEqualToString:@"0187"];
};
[PIN presentFromViewController:self animated:YES];
[PIN release];