Skip to content

Commit

Permalink
YouTubeRebornPlus Settings Search Bar
Browse files Browse the repository at this point in the history
  • Loading branch information
arichornlover authored Jan 9, 2024
1 parent 3d23bb7 commit 17f9a27
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Source/Settings.xm
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,24 @@ static const NSInteger YouTubeRebornPlusSection = 500;

extern NSBundle *YouTubeRebornPlusBundle();

// Settings Search Bar
%hook YTSettingsViewController
- (void)loadWithModel:(id)model fromView:(UIView *)view {
%orig;
if ([[self valueForKey:@"_detailsCategoryID"] integerValue] == YouTubeRebornPlusSection)
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 {
Expand Down

0 comments on commit 17f9a27

Please sign in to comment.