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 2 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
8 changes: 6 additions & 2 deletions src/KKPasscodeSettingsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ - (void)tableView:(UITableView*)tableView didSelectRowAtIndexPath:(NSIndexPath*)
nav.navigationBar.barStyle = self.navigationController.navigationBar.barStyle;
}

[self.delegate passcodeLockWillBePresented];
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should check if the function exists in the delegate before invoking it. perhaps some users won't implement this function


[self.navigationController presentModalViewController:nav animated:YES];


Expand All @@ -210,9 +212,11 @@ - (void)tableView:(UITableView*)tableView didSelectRowAtIndexPath:(NSIndexPath*)
nav.navigationBar.barStyle = self.navigationController.navigationBar.barStyle;
}

[self.navigationController presentModalViewController:nav animated:YES];
[tableView deselectRowAtIndexPath:indexPath animated:YES];
[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