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:
parent
08eeae68d9
commit
86ca725b54
1 changed files with 18 additions and 0 deletions
18
Settings.xm
18
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<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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue