Update uYouPlus.xm

This commit is contained in:
arichornlover 2024-06-25 22:51:43 -05:00 committed by GitHub
parent 654bce5531
commit f60bc5f283
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -100,10 +100,15 @@ NSBundle *tweakBundle = uYouPlusBundle();
}
%new;
- (void)settingsAction {
YTSettingsViewController *settingsVC = [[YTSettingsViewController alloc] init];
UIViewController *rootVC = [UIApplication sharedApplication].keyWindow.rootViewController;
UINavigationController *navController = (UINavigationController *)rootVC;
[navController pushViewController:settingsVC animated:YES];
Class YTSettingsViewControllerClass = objc_getClass("YTSettingsViewController");
if (YTSettingsViewControllerClass) {
YTSettingsViewController *settingsVC = [[YTSettingsViewControllerClass alloc] init];
UIViewController *rootVC = [UIApplication sharedApplication].keyWindow.rootViewController;
UINavigationController *navController = (UINavigationController *)rootVC;
[navController pushViewController:settingsVC animated:YES];
} else {
NSLog(@"YTSettingsViewController class not found.");
}
}
%end