PasswordDialogViewController is a simple password dialog UIViewController class.
- iOS7.1+
PasswordDialogViewController is available on cocoapods.
pod 'PasswordDialogViewController'
or include the PasswordDialogViewController class in your project.
#import "PasswordDialogViewController.h"
@implementation ViewController
- (IBAction)pressPasswordDialogButton:(id)sender {
NSString *masterPassword = @"password";
PasswordDialogViewController *viewController;
viewController = [[PasswordDialogViewController alloc] initWithPassword:masterPassword];
viewController.delegate = self;
viewController.titleText = @"Title";
viewController.messageText = @"This is message.";
[viewController show:^(BOOL isOK) {
if (isOK) {
NSLog(@"Succeed");
}
else {
NSLog(@"Cancel");
}
}];
}
@end
This PasswordDialogViewController is released under the MIT License. See LICENSE for details.