Skip to content

Commit

Permalink
Updated README. Changed frame depending on status bar visibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
Roland Leth committed Jul 9, 2014
1 parent 13ba5e4 commit 7b99971
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Demo/LTHPasscodeViewController Demo/LTHAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
[self.window makeKeyAndVisible];

// [LTHPasscodeViewController sharedUser].delegate = self;
[LTHPasscodeViewController useKeychain:NO];
if ([LTHPasscodeViewController doesPasscodeExist]) {
if ([LTHPasscodeViewController didPasscodeTimerEnd])
[[LTHPasscodeViewController sharedUser] showLockScreenWithAnimation:YES
withLogout:NO
andLogoutTitle:nil];
// [LTHPasscodeViewController useKeychain:YES];
if ([LTHPasscodeViewController doesPasscodeExist] &&
[LTHPasscodeViewController didPasscodeTimerEnd]) {
[[LTHPasscodeViewController sharedUser] showLockScreenWithAnimation:YES
withLogout:NO
andLogoutTitle:nil];
}

return YES;
Expand Down
3 changes: 3 additions & 0 deletions LTHPasscodeViewController/LTHPasscodeViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -759,6 +759,9 @@ - (void)showLockScreenWithAnimation:(BOOL)animated withLogout:(BOOL)hasLogout an
newCenter = CGPointMake(mainWindow.center.x,
mainWindow.center.y + self.navigationController.navigationBar.frame.size.height / 2);
}
if (![UIApplication sharedApplication].statusBarHidden) {
newCenter.y += [[UIApplication sharedApplication] statusBarFrame].size.height;
}

if (animated) {
[UIView animateWithDuration: _lockAnimationDuration animations: ^{
Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@ Simple to use iOS 7 style Passcode - the one you get in Settings when changing y
# How to use
Drag the contents of `LTHPasscodeViewController` to your project, or add `pod 'LTHPasscodeViewController'` to your podspec file.

Example, called in `application:didFinishLaunchingWithOptions`:

```objc
[LTHPasscodeViewController useKeychain:NO];
if ([LTHPasscodeViewController doesPasscodeExist]) {
if ([LTHPasscodeViewController didPasscodeTimerEnd])
[[LTHPasscodeViewController sharedUser] showLockScreenWithAnimation:YES
withLogout:NO
andLogoutTitle:nil];
}
```
* Supports simple (4 digit) and complex passcodes.
* Data us saved in the Keychain, by default. Supports custom saving, by calling `[LTHPasscodeViewController useKeychain:NO]` after initializing and implementing a few protocol methods (the same names the library uses for the same job):
Expand Down

0 comments on commit 7b99971

Please sign in to comment.