I have designed a small library (with its test project) that lets you implement a passcode lock screen on iOS. The library is compatible with iPod Touch, iPhone and iPad. And it is very easy to use.
EAPasscodeLock* passcodeManager = [[EAPasscodeLock alloc] init];
UIViewController* plViewController = [passcodeManager passcodeViewControllerWithCode:@"1234" cancellable:YES hintText:nil maxRetries:4 delegate:self];
[self presentModalViewController:plViewController animated:NO];
There is a protocol you should implement, with only one obligatory method, that sends messages to the main view.
// Called when the passcode is entered correctly after dismissing the passcode View Controller
// Called when the passcode is entered correctly before dismissing the passcode View Controller
// Called when a passcode entered is incorrect
// Called when the cancel button was pressed and after the passcode View Controller is dismissed
// Called when the passcode was entered incorrectly too many times
Here a few screenshots of the iPad UI
Empty passcode screen
Typing the code
Wrong passcode message
Find the lastest version on GitHub: https://github.com/eaceto/EAPasscodeLock