From 829b0c7d6bad029369770a598afd4d7a46bce896 Mon Sep 17 00:00:00 2001 From: arichornlover <78001398+arichornlover@users.noreply.github.com> Date: Fri, 12 Jul 2024 15:02:22 -0500 Subject: [PATCH] Update uYouPlusPatches.xm --- Sources/uYouPlusPatches.xm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Sources/uYouPlusPatches.xm b/Sources/uYouPlusPatches.xm index f6897ff..24bae43 100644 --- a/Sources/uYouPlusPatches.xm +++ b/Sources/uYouPlusPatches.xm @@ -146,12 +146,16 @@ static BOOL showNativeShareSheet(NSString *serializedShareEntity) { UIViewController *topViewController = [%c(YTUIUtils) topViewControllerForPresenting]; - if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) { + if (activityViewController.popoverPresentationController) { activityViewController.popoverPresentationController.sourceView = topViewController.view; + + CGFloat screenWidth = [UIScreen mainScreen].bounds.size.width; + CGFloat screenHeight = [UIScreen mainScreen].bounds.size.height; + + activityViewController.popoverPresentationController.sourceRect = CGRectMake(screenWidth / 2.0, screenHeight, 0, 0); + activityViewController.popoverPresentationController.permittedArrowDirections = UIPopoverArrowDirectionAny; } - [topViewController presentViewController:activityViewController animated:YES completion:nil]; - return YES; } @@ -347,7 +351,6 @@ static void refreshUYouAppearance() { // Disable uYou's playback speed controls (prevent crash on video playback https://github.com/therealFoxster/uYouPlus/issues/2#issuecomment-1894912963) // [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"showPlaybackRate"]; - // Disable uYou's adblock [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"removeYouTubeAds"]; }