From 11ddcd421d265772fa13a8d4dfafcbf796e15339 Mon Sep 17 00:00:00 2001 From: level3tjg Date: Sat, 27 Aug 2022 02:49:20 -0400 Subject: [PATCH] Workaround for iOS 15 uYou settings bug (#10) --- Header.h | 3 +++ uYouPlus.xm | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/Header.h b/Header.h index b776d49..49a4131 100644 --- a/Header.h +++ b/Header.h @@ -30,6 +30,9 @@ @interface FRPSliderCell : UITableViewCell @end +@interface boolSettingsVC : UIViewController +@end + // iOS16 fix @interface OBPrivacyLinkButton : UIButton - (instancetype)initWithCaption:(NSString *)caption diff --git a/uYouPlus.xm b/uYouPlus.xm index fd7ca68..1fd6383 100644 --- a/uYouPlus.xm +++ b/uYouPlus.xm @@ -222,6 +222,16 @@ BOOL hidePaidPromotionCard() { } %end +// Workaround for qnblackcat/uYouPlus#10 +%hook boolSettingsVC +- (instancetype)initWithTitle:(NSString *)title sections:(NSArray *)sections footer:(NSString *)footer { + if (@available(iOS 15, *)) + if (![self valueForKey:@"_lastNotifiedTraitCollection"]) + [self setValue:[UITraitCollection currentTraitCollection] forKey:@"_lastNotifiedTraitCollection"]; + return %orig; +} +%end + // YTClassicVideoQuality: https://github.com/PoomSmart/YTClassicVideoQuality %hook YTVideoQualitySwitchControllerFactory - (id)videoQualitySwitchControllerWithParentResponder:(id)responder {