Skip to content

Commit

Permalink
feat: hide reels tab
Browse files Browse the repository at this point in the history
Implementation taken from vlourme@481fe46
  • Loading branch information
SoCuul committed Apr 15, 2024
1 parent 23463d8 commit bea23eb
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ A feature-rich tweak for Instagram on iOS!\
# Features
### General
- Copy description
- Hide reels tab
- Do not save recent searches
- Hide explore posts grid
- Hide trending searches
Expand Down
1 change: 1 addition & 0 deletions src/Controllers/SettingsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ - (NSArray *)specifiers {
// Section 1: General
[self newSectionWithTitle:@"General" footer:nil],
[self newSwitchCellWithTitle:@"Copy description" detailTitle:@"Copy the post description with a long press" key:@"copy_description" defaultValue:true changeAction:nil],
[self newSwitchCellWithTitle:@"Hide reels tab" detailTitle:@"Hides the reels tab on the bottom navbar" key:@"hide_reels_tab" defaultValue:false changeAction:nil],
[self newSwitchCellWithTitle:@"Do not save recent searches" detailTitle:@"Search bars will no longer save your recent searches" key:@"no_recent_searches" defaultValue:false changeAction:nil],
[self newSwitchCellWithTitle:@"Hide explore posts grid" detailTitle:@"Hides the grid of suggested posts on the explore/search tab" key:@"hide_explore_grid" defaultValue:false changeAction:nil],
[self newSwitchCellWithTitle:@"Hide trending searches" detailTitle:@"Hides the trending searches under the explore search bar" key:@"hide_trending_searches" defaultValue:true changeAction:nil],
Expand Down
21 changes: 21 additions & 0 deletions src/Features/General/HideReelsTab.x
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#import "../../InstagramHeaders.h"
#import "../../Manager.h"

// Hide reels tab
%hook IGTabBar
- (void)didMoveToWindow {
%orig;

if ([BHIManager hideReelsTab]) { // !! change to "hideReelsTab" before commit
NSMutableArray *tabButtons = [self valueForKey:@"_tabButtons"];

NSLog(@"[BHInsta] Hiding reels tab");

if ([tabButtons count] == 5) {
[tabButtons removeObjectAtIndex:3];
}

[self.subviews[4] setHidden:YES];
}
}
%end
3 changes: 3 additions & 0 deletions src/InstagramHeaders.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
@interface IGProfileMenuSheetViewController : IGViewController
@end

@interface IGTabBar: UIView
@end

@interface IGTableViewCell: UITableViewCell
- (id)initWithReuseIdentifier:(NSString *)identifier;
@end
Expand Down
1 change: 1 addition & 0 deletions src/Manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
+ (BOOL)stickerInteractConfirmation;
+ (BOOL)postCommentConfirmation;
+ (BOOL)copyDecription;
+ (BOOL)hideReelsTab;
+ (BOOL)noRecentSearches;
+ (BOOL)hideExploreGrid;
+ (BOOL)hideTrendingSearches;
Expand Down
3 changes: 3 additions & 0 deletions src/Manager.m
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ + (BOOL)postCommentConfirmation {
+ (BOOL)copyDecription {
return [[NSUserDefaults standardUserDefaults] boolForKey:@"copy_description"];
}
+ (BOOL)hideReelsTab {
return [[NSUserDefaults standardUserDefaults] boolForKey:@"hide_reels_tab"];
}
+ (BOOL)noRecentSearches {
return [[NSUserDefaults standardUserDefaults] boolForKey:@"no_recent_searches"];
}
Expand Down

0 comments on commit bea23eb

Please sign in to comment.