reimplement 15.0-15.1.1 crash fix

This commit is contained in:
level3tjg 2023-04-27 14:02:00 -04:00
parent 446a583014
commit 4794a7ab2d

View file

@ -32,12 +32,13 @@ static BOOL oldDarkTheme() {
//
# pragma mark - uYou's patches
// 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;
%hook UIViewController
- (UITraitCollection *)traitCollection {
@try {
return %orig;
} @catch(NSException *e) {
return [UITraitCollection currentTraitCollection];
}
}
%end