Pārlūkot izejas kodu

VLCPlaybackController: The delegate is not always a UIViewController instead use the topmost controller

Carola Nitz 7 gadi atpakaļ
vecāks
revīzija
f71180b520
1 mainītis faili ar 4 papildinājumiem un 1 dzēšanām
  1. 4 1
      Sources/VLCPlaybackController.m

+ 4 - 1
Sources/VLCPlaybackController.m

@@ -1195,10 +1195,13 @@ typedef NS_ENUM(NSUInteger, VLCAspectRatio) {
                                                                                                                              [self setPlaybackPosition:lastPosition];
                                                                                                                          }]
                                                              ];
+                UIViewController *presentingVC = [UIApplication sharedApplication].delegate.window.rootViewController;
+                presentingVC = presentingVC.presentedViewController ?: presentingVC;
                 [VLCAlertViewController alertViewManagerWithTitle:NSLocalizedString(@"CONTINUE_PLAYBACK", nil)
                                                      errorMessage:[NSString stringWithFormat:NSLocalizedString(@"CONTINUE_PLAYBACK_LONG", nil), item.title]
-                                                   viewController:self.delegate
+                                                   viewController:presentingVC
                                                     buttonsAction:buttonsAction];
+
             }
         }
     }