mirror of
https://github.com/arichornlover/uYouEnhanced.git
synced 2026-04-20 23:22:09 +00:00
Added Settings Search Bar
This commit is contained in:
parent
4362a638fe
commit
12a3290350
1 changed files with 21 additions and 0 deletions
21
Settings.xm
21
Settings.xm
|
|
@ -1,4 +1,5 @@
|
|||
#import "Tweaks/YouTubeHeader/YTSettingsViewController.h"
|
||||
#import "Tweaks/YouTubeHeader/YTSearchableSettingsViewController.h"
|
||||
#import "Tweaks/YouTubeHeader/YTSettingsSectionItem.h"
|
||||
#import "Tweaks/YouTubeHeader/YTSettingsSectionItemManager.h"
|
||||
#import "Tweaks/YouTubeHeader/YTUIUtils.h"
|
||||
|
|
@ -40,6 +41,26 @@ extern BOOL dontEatMyContent();
|
|||
}
|
||||
%end
|
||||
|
||||
%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
|
||||
|
||||
%hook YTSettingsSectionItemManager
|
||||
%new
|
||||
- (void)updateuYouPlusSectionWithEntry:(id)entry {
|
||||
|
|
|
|||
Loading…
Reference in a new issue