Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: hide open camera tab #66

Closed
jvcliment opened this issue Jun 17, 2024 · 1 comment
Closed

feat: hide open camera tab #66

jvcliment opened this issue Jun 17, 2024 · 1 comment
Assignees

Comments

@jvcliment
Copy link

I have eliminated the Open Camera tab because from the Profile tab the same purpose can be done with the button located next to the three configuration bars in new versions of Instagram. This helps reduce visual noise for those who don't want too many distractions.

This button.
Captura de pantalla 2024-06-17 a las 21 02 07

This is the code that I have used, the HideReelTab code should also be changed by adding the two for loops (the second is optional I think) since it is designed to eliminate the reels tab taking into account that none has been previously deleted.

#import "../../InstagramHeaders.h"
#import "../../Manager.h"

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

    if ([SCIManager hideOpenCameraTab]) {
        NSMutableArray *tabButtons = [self valueForKey:@"_tabButtons"];
        NSString *targetLabel = @"Open Camera";
        
        NSLog(@"[SCInsta] Hiding open camera tab");
        
        for (NSUInteger i = 0; i < [tabButtons count]; i++) {
            UIButton *button = [tabButtons objectAtIndex:i];
            if ([[button accessibilityLabel] isEqualToString:targetLabel]) {
                [tabButtons removeObjectAtIndex:i];
                break;
            }
        }
        
        for (UIButton *button in self.subviews) {
            if ([[button accessibilityLabel] isEqualToString:targetLabel]) {
                [button setHidden:YES];
                break;
            }
        }
    }
}
%end
@jvcliment jvcliment changed the title feat: hide Open Camera tab feat: hide open camera tab Jun 17, 2024
@SoCuul
Copy link
Owner

SoCuul commented Jun 17, 2024

What I'm probably gonna do is add a toggle to remove any of the bottom buttons, or possibly rearrange them (if I can implement that). Possibly add a messages button as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants