diff --git a/VENTouchLock/Categories/UIViewController+VENTouchLock.h b/VENTouchLock/Categories/UIViewController+VENTouchLock.h index 2ca09b3..3768a9d 100644 --- a/VENTouchLock/Categories/UIViewController+VENTouchLock.h +++ b/VENTouchLock/Categories/UIViewController+VENTouchLock.h @@ -8,8 +8,9 @@ + (UIViewController*)ventouchlock_topMostController; /** + * @param navigationBarClass The navigation bar class that should be used to initialize the navigation controller. Defaults to UINavigationBar. * @return A navigation controller that contains the reciever as its root view controller. */ -- (UINavigationController *)ventouchlock_embeddedInNavigationController; +- (UINavigationController *)ventouchlock_embeddedInNavigationControllerWithNavigationBarClass:(Class)navigationBarClass; @end \ No newline at end of file diff --git a/VENTouchLock/Categories/UIViewController+VENTouchLock.m b/VENTouchLock/Categories/UIViewController+VENTouchLock.m index 24d4520..e75ef42 100644 --- a/VENTouchLock/Categories/UIViewController+VENTouchLock.m +++ b/VENTouchLock/Categories/UIViewController+VENTouchLock.m @@ -2,10 +2,10 @@ @implementation UIViewController (VENTouchLock) -- (UINavigationController *)ventouchlock_embeddedInNavigationController +- (UINavigationController *)ventouchlock_embeddedInNavigationControllerWithNavigationBarClass:(Class)navigationBarClass { - UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:self]; - navigationController.navigationBar.translucent = NO; + UINavigationController *navigationController = [[UINavigationController alloc] initWithNavigationBarClass:navigationBarClass toolbarClass:nil]; + [navigationController pushViewController:self animated:NO]; return navigationController; } diff --git a/VENTouchLock/Controllers/VENTouchLockPasscodeViewController.m b/VENTouchLock/Controllers/VENTouchLockPasscodeViewController.m index 7afd343..b0f7faf 100644 --- a/VENTouchLock/Controllers/VENTouchLockPasscodeViewController.m +++ b/VENTouchLock/Controllers/VENTouchLockPasscodeViewController.m @@ -102,7 +102,7 @@ - (void)finishWithResult:(BOOL)success animated:(BOOL)animated - (UINavigationController *)embeddedInNavigationController { - return [super ventouchlock_embeddedInNavigationController]; + return [super ventouchlock_embeddedInNavigationControllerWithNavigationBarClass:self.touchLock.appearance.navigationBarClass]; } - (void)keyboardWillShow:(NSNotification *)notification diff --git a/VENTouchLock/Models/VENTouchLockAppearance.h b/VENTouchLock/Models/VENTouchLockAppearance.h index 7614638..15fe62c 100644 --- a/VENTouchLock/Models/VENTouchLockAppearance.h +++ b/VENTouchLock/Models/VENTouchLockAppearance.h @@ -44,4 +44,6 @@ @property (assign, nonatomic) BOOL touchIDCancelPresentsPasscodeViewController; +@property (strong, nonatomic) Class navigationBarClass; + @end \ No newline at end of file diff --git a/VENTouchLock/Models/VENTouchLockAppearance.m b/VENTouchLock/Models/VENTouchLockAppearance.m index 311cf46..65802a0 100644 --- a/VENTouchLock/Models/VENTouchLockAppearance.m +++ b/VENTouchLock/Models/VENTouchLockAppearance.m @@ -20,6 +20,7 @@ - (instancetype)init _enterPasscodeViewControllerTitle = NSLocalizedString(@"Enter Passcode", nil); _splashShouldEmbedInNavigationController = NO; _touchIDCancelPresentsPasscodeViewController = NO; + _navigationBarClass = [UINavigationBar class]; } return self; } diff --git a/VENTouchLock/VENTouchLock.m b/VENTouchLock/VENTouchLock.m index fa5fbe9..a6272e8 100644 --- a/VENTouchLock/VENTouchLock.m +++ b/VENTouchLock/VENTouchLock.m @@ -185,7 +185,7 @@ - (void)lock UIViewController *rootViewController = [UIViewController ventouchlock_topMostController]; UIViewController *displayController; if (self.appearance.splashShouldEmbedInNavigationController) { - displayController = [splashViewController ventouchlock_embeddedInNavigationController]; + displayController = [splashViewController ventouchlock_embeddedInNavigationControllerWithNavigationBarClass:self.appearance.navigationBarClass]; } else { displayController = splashViewController; @@ -198,7 +198,7 @@ - (void)lock [snapshotSplashViewController setIsSnapshotViewController:YES]; UIViewController *snapshotDisplayController; if (self.appearance.splashShouldEmbedInNavigationController) { - snapshotDisplayController = [snapshotSplashViewController ventouchlock_embeddedInNavigationController]; + snapshotDisplayController = [snapshotSplashViewController ventouchlock_embeddedInNavigationControllerWithNavigationBarClass:self.appearance.navigationBarClass]; } else { snapshotDisplayController = snapshotSplashViewController;