panamind wrote:
Wow, he sells that for 100 Euros??? I wrote my own and it took me one hour. No thanks! Let me know if you want the code, I'll give it to you.
I can foresee needing something like this in the future. If you don't mind I'll take a look.
This e-mail address is being protected from spambots. You need JavaScript enabled to view it
I've attached it below. I'm in a rush, so I didn't have time to remove code specific to my app, but you should be able to figure out what fits and what doesn't. Basically, you can use this two ways. The first is when you parent it off the window, in which case you need to set the parent to whatever displayed it (look in the done function). The other case is when you are pushing it, in which case there is no parent. The controller doubles up as a way to set the passcode as well. In this case you would set areSetting to YES. Code below.
This being said, it's probably not as awesome as his, but still... 100 Euros?
Let me know if you find any glaring issues in the code while you're at it!
With parent:
passcodeViewController = [[PasscodeViewController alloc] initWithNibName:@"PasscodeViewController" bundle:nil];
passcodeViewController.parent = self;
passcodeViewController.areSetting = NO;
[window addSubview:passcodeViewController.view];
[passcodeViewController showKeyboard];
Without parent:
passcodeViewController.parent = nil;
passcodeViewController.areSetting = YES;
passcodeViewController.navigationItem.title = @"Set Passcode";
UIBarButtonItem *backButton = [[UIBarButtonItem alloc] initWithTitle:@"Reset" style:UIBarButtonItemStyleBordered target:nil action:nil];
self.navigationItem.backBarButtonItem = backButton;
[backButton release];
[self.navigationController pushViewController:passcodeViewController animated:YES];
[passcodeViewController showKeyboard];
This attachment is hidden for guests. Please log in or register to see it.