reimplement 15.0-15.1.1 crash fix
This commit is contained in:
parent
446a583014
commit
4794a7ab2d
1 changed files with 7 additions and 6 deletions
13
uYouPlus.xm
13
uYouPlus.xm
|
|
@ -32,12 +32,13 @@ static BOOL oldDarkTheme() {
|
||||||
//
|
//
|
||||||
# pragma mark - uYou's patches
|
# pragma mark - uYou's patches
|
||||||
// Workaround for qnblackcat/uYouPlus#10
|
// Workaround for qnblackcat/uYouPlus#10
|
||||||
%hook boolSettingsVC
|
%hook UIViewController
|
||||||
- (instancetype)initWithTitle:(NSString *)title sections:(NSArray *)sections footer:(NSString *)footer {
|
- (UITraitCollection *)traitCollection {
|
||||||
if (@available(iOS 15, *))
|
@try {
|
||||||
if (![self valueForKey:@"_lastNotifiedTraitCollection"])
|
return %orig;
|
||||||
[self setValue:[UITraitCollection currentTraitCollection] forKey:@"_lastNotifiedTraitCollection"];
|
} @catch(NSException *e) {
|
||||||
return %orig;
|
return [UITraitCollection currentTraitCollection];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
%end
|
%end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue