From e5894e72910248a4adb5d26cfd8600dac282552a Mon Sep 17 00:00:00 2001 From: Dan <38832025+dayanch96@users.noreply.github.com> Date: Sun, 10 Mar 2024 06:35:48 +0300 Subject: [PATCH] Getting rid of the first object --- YTLite.x | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/YTLite.x b/YTLite.x index 81746c5..d811a99 100644 --- a/YTLite.x +++ b/YTLite.x @@ -809,7 +809,7 @@ static BOOL isOverlayShown = YES; if (ytlBool(@"pinchToFullscreenShorts") && [self.playerViewDelegate.parentViewController isKindOfClass:NSClassFromString(@"YTShortsPlayerViewController")]) { YTShortsPlayerViewController *shortsPlayerVC = (YTShortsPlayerViewController *)self.playerViewDelegate.parentViewController; YTReelContentView *contentView = (YTReelContentView *)shortsPlayerVC.view; - UIWindow *mainWindow = [UIApplication sharedApplication].windows.firstObject; + UIWindow *mainWindow = [[[UIApplication sharedApplication] delegate] window]; YTAppViewController *appVC = (YTAppViewController *)mainWindow.rootViewController; if (gesture.scale > 1) { @@ -853,7 +853,7 @@ static BOOL isOverlayShown = YES; [[%c(YTToastResponderEvent) eventWithMessage:LOC(@"ShortsModeTurnedOff") firstResponder:[%c(YTUIUtils) topViewControllerForPresenting]] send]; - UIWindow *mainWindow = [UIApplication sharedApplication].windows.firstObject; + UIWindow *mainWindow = [[[UIApplication sharedApplication] delegate] window]; YTAppViewController *appVC = (YTAppViewController *)mainWindow.rootViewController; [appVC performSelector:@selector(showPivotBar) withObject:nil afterDelay:1.0]; }