Explorar o código

VLCSettingsController: Embed PAPasscodeViewController in UINavigationController

(Closes #330)
Nishith Singh %!s(int64=6) %!d(string=hai) anos
pai
achega
7b10ce49dc
Modificáronse 1 ficheiros con 3 adicións e 2 borrados
  1. 3 2
      Sources/VLCSettingsController.m

+ 3 - 2
Sources/VLCSettingsController.m

@@ -134,7 +134,8 @@ NSString * const kVLCSectionTableHeaderViewIdentifier = @"VLCSectionTableHeaderV
         if (passcodeOn) {
             PAPasscodeViewController *passcodeLockController = [[PAPasscodeViewController alloc] initForAction:PasscodeActionSet];
             passcodeLockController.delegate = self;
-            [self.navigationController presentViewController:passcodeLockController animated:YES completion:nil];
+            UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:passcodeLockController];
+            [self.navigationController presentViewController:navigationController animated:YES completion:nil];
         }
     }
     if ([notification.object isEqual:kVLCSettingAppTheme]) {
@@ -195,7 +196,7 @@ NSString * const kVLCSectionTableHeaderViewIdentifier = @"VLCSectionTableHeaderV
         [[NSUserDefaults standardUserDefaults] setBool:passcodeEnabled forKey:kVLCSettingPasscodeOnKey];
         [self updateUIAndCoreSpotlightForPasscodeSetting:passcode != nil];
     }
-    if ([self.navigationController.presentedViewController isKindOfClass:[PAPasscodeViewController class]]) {
+    if ([self.navigationController.presentedViewController isKindOfClass:[UINavigationController class]] && [((UINavigationController *)self.navigationController.presentedViewController).viewControllers.firstObject isKindOfClass:[PAPasscodeViewController class]]) {
         [self.navigationController.presentedViewController dismissViewControllerAnimated:YES completion:nil];
     }
 }