diff --git a/Settings.xm b/Settings.xm index 4cd6616..708d3e3 100644 --- a/Settings.xm +++ b/Settings.xm @@ -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(self, "_shouldShowSearchBar") = YES; +} +- (void)setSectionControllers { + %orig; + if (MSHookIvar(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 {