Skip to content
This repository has been archived by the owner on May 13, 2019. It is now read-only.

KKPasscodeSettingsViewControllerDelegate:passcodeLockWillBePresented #11

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/KKPasscodeSettingsViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@
*/
- (void)didSettingsChanged:(KKPasscodeSettingsViewController*)viewController;

/**
* called when the passcode lock dialog will be presented
*/
- (void)passcodeLockWillBePresented;

@end

@interface KKPasscodeSettingsViewController : UITableViewController <UIActionSheetDelegate, KKPasscodeViewControllerDelegate> {
Expand Down
11 changes: 8 additions & 3 deletions src/KKPasscodeSettingsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,11 @@ - (void)tableView:(UITableView*)tableView didSelectRowAtIndexPath:(NSIndexPath*)
nav.navigationBar.barStyle = self.navigationController.navigationBar.barStyle;
}

if ([self.delegate respondsToSelector:@selector(passcodeLockWillBePresented)]) {
[self.delegate passcodeLockWillBePresented];
}
[self.navigationController presentModalViewController:nav animated:YES];


} else if (indexPath.section == 1 && _passcodeLockOn) {
KKPasscodeViewController *vc = [[KKPasscodeViewController alloc] initWithNibName:nil bundle:nil];
vc.delegate = self;
Expand All @@ -210,9 +212,12 @@ - (void)tableView:(UITableView*)tableView didSelectRowAtIndexPath:(NSIndexPath*)
nav.navigationBar.barStyle = self.navigationController.navigationBar.barStyle;
}

[self.navigationController presentModalViewController:nav animated:YES];
[tableView deselectRowAtIndexPath:indexPath animated:YES];
if ([self.delegate respondsToSelector:@selector(passcodeLockWillBePresented)]) {
[self.delegate passcodeLockWillBePresented];
}
[self.navigationController presentModalViewController:nav animated:YES];
}
[tableView deselectRowAtIndexPath:indexPath animated:YES];
}

- (void)didSettingsChanged:(KKPasscodeViewController*)viewController
Expand Down
5 changes: 5 additions & 0 deletions src/KKPasscodeViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ @implementation KKPasscodeViewController
#pragma mark -
#pragma mark UIViewController

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad;
}

- (void)loadView
{
[super loadView];
Expand Down