Re-implement uYouPlus Settings Search Bar

After nearly 2 years, I have decided to re-add this feature since settings look different ;) enjoy! Hope it’s easier!
This commit is contained in:
arichornlover 2024-01-08 17:33:39 -06:00 committed by GitHub
parent 08eeae68d9
commit 86ca725b54
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -30,6 +30,24 @@ static const NSInteger uYouPlusSection = 500;
extern NSBundle *uYouPlusBundle();
// Settings Search Bar
%hook YTSettingsViewController
- (void)loadWithModel:(id)model fromView:(UIView *)view {
%orig;
if ([[self valueForKey:@"_detailsCategoryID"] integerValue] == uYouPlusSection)
MSHookIvar<BOOL>(self, "_shouldShowSearchBar") = YES;
}
- (void)setSectionControllers {
%orig;
if (MSHookIvar<BOOL>(self, "_shouldShowSearchBar")) {
YTSettingsSectionController *settingsSectionController = [self settingsSectionControllers][[self valueForKey:@"_detailsCategoryID"]];
YTSearchableSettingsViewController *searchableVC = [self valueForKey:@"_searchableSettingsViewController"];
if (settingsSectionController)
[searchableVC storeCollectionViewSections:@[settingsSectionController]];
}
}
%end
// Settings
%hook YTAppSettingsPresentationData
+ (NSArray *)settingsCategoryOrder {