mirror of
https://github.com/arichornlover/uYouEnhanced.git
synced 2026-03-11 21:26:04 +00:00
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
|
||||
// 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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue