Pārlūkot izejas kodu

VLCSettingsController: Embed PAPasscodeViewController in UINavigationController

(Closes #330)
Nishith Singh 6 gadi atpakaļ
vecāks
revīzija
7b10ce49dc
1 mainītis faili ar 3 papildinājumiem un 2 dzēšanām
  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];
     }
 }