From 9c0ef820df42e46da6e0ca8264a5b667dd0be939 Mon Sep 17 00:00:00 2001 From: Babouche35 <164264951+Babouche35@users.noreply.github.com> Date: Sat, 27 Sep 2025 16:45:07 +0200 Subject: [PATCH 01/18] Update Tweak.x --- Tweak.x | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Tweak.x b/Tweak.x index fc2ffa13..1dc1be7a 100644 --- a/Tweak.x +++ b/Tweak.x @@ -1671,6 +1671,15 @@ static void batchSwizzlingOnClass(Class cls, NSArray*origSelectors, I } %end +@interface TFNScrollingSegmentedViewController : UIViewController +- (void)setSelectedIndex:(NSInteger)index; +- (NSInteger)selectedIndex; +@end + +@interface THFTimelineViewController : UIViewController +- (void)_pullToRefresh:(id)sender; +@end + // start of NFB features // MARK: Restore Source Labels - This is still pretty experimental and may break. This restores Tweet Source Labels by using an Legacy API. by: @nyaathea From 8e5eceb03be511086a6719f3f7890d1aa1eb4156 Mon Sep 17 00:00:00 2001 From: Babouche35 <164264951+Babouche35@users.noreply.github.com> Date: Sat, 27 Sep 2025 17:11:28 +0200 Subject: [PATCH 02/18] Update Tweak.x --- Tweak.x | 89 +++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 80 insertions(+), 9 deletions(-) diff --git a/Tweak.x b/Tweak.x index 1dc1be7a..7699d484 100644 --- a/Tweak.x +++ b/Tweak.x @@ -433,6 +433,86 @@ static void batchSwizzlingOnClass(Class cls, NSArray*origSelectors, I } } } + +- (void)setTabBarHidden:(BOOL)arg1 withDuration:(CGFloat)arg2 { + if ([BHTManager stopHidingTabBar]) { + return; + } + + return %orig; +} +- (void)setTabBarHidden:(BOOL)arg1 { + if ([BHTManager stopHidingTabBar]) { + return; + } + + return %orig; +} +%end + +%hook TFNScrollingSegmentedViewController +// Selectively hide the tab bar only on homepage +- (BOOL)_tfn_shouldHideLabelBar { + // Only hide the label bar in the home timeline + if (isHomeTimelineContainer(self)) { + return YES; + } + + // For all other interfaces, use default behavior + return %orig; +} + +// Sets the number of tabs in the sub bar +- (NSInteger)pagingViewController:(id)arg1 numberOfPagesInSection:(id)arg2 { + return %orig; +} + +// Returns the "Following" tab's view controller for both tabs, but only on homepage +- (UIViewController *)pagingViewController:(UIViewController *)viewController viewControllerAtIndexPath:(NSIndexPath *)indexPath { + if (isHomeTimelineContainer(self)) { + // Always use the Following tab (index 1) + NSIndexPath *followingIndexPath = [NSIndexPath indexPathForRow:1 inSection:0]; + return %orig(viewController, followingIndexPath); + } + + return %orig(viewController, indexPath); +} + +// Ensure proper view loading and prevent white screen, only on homepage +- (void)viewDidLoad { + %orig; + + if (isHomeTimelineContainer(self)) { + [self setSelectedIndex:1]; + } +} + +// Additional fix for view appearance to ensure content loads properly, only on homepage +- (void)viewDidAppear:(BOOL)animated { + %orig; + + if (isHomeTimelineContainer(self)) { + [self setSelectedIndex:1]; + refreshViewIfNeeded(self.view, 0.1); + } +} + +// Ensure selected index is always the Following tab, only on homepage +- (void)setSelectedIndex:(NSInteger)index { + if (isHomeTimelineContainer(self)) { + %orig(1); // Always set to Following tab (index 1) + } else { + %orig(index); // Use the original index for other interfaces + } +} +%end + +// Fix refresh functionality +%hook THFTimelineViewController +- (void)_pullToRefresh:(id)sender { + %orig; + refreshViewIfNeeded(self.view, 0.5); +} %end %hook T1DirectMessageConversationEntriesViewController @@ -1671,15 +1751,6 @@ static void batchSwizzlingOnClass(Class cls, NSArray*origSelectors, I } %end -@interface TFNScrollingSegmentedViewController : UIViewController -- (void)setSelectedIndex:(NSInteger)index; -- (NSInteger)selectedIndex; -@end - -@interface THFTimelineViewController : UIViewController -- (void)_pullToRefresh:(id)sender; -@end - // start of NFB features // MARK: Restore Source Labels - This is still pretty experimental and may break. This restores Tweet Source Labels by using an Legacy API. by: @nyaathea From 9d43808e2fd721ab214e8b006e0ffa40850a1ab6 Mon Sep 17 00:00:00 2001 From: Babouche35 <164264951+Babouche35@users.noreply.github.com> Date: Sat, 27 Sep 2025 17:20:25 +0200 Subject: [PATCH 03/18] Update Tweak.x --- Tweak.x | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Tweak.x b/Tweak.x index 7699d484..9dabc887 100644 --- a/Tweak.x +++ b/Tweak.x @@ -25,6 +25,14 @@ #import #import #import "ModernSettingsViewController.h" +#import "T1PlayerMediaEntitySessionProducible.h" +#import "TFSTwitterEntityMediaVideoVariant.h" +#import "JGProgressHUD.h" +#import "TFNActiveTextItem.h" +#import "TFNAttributedTextModel.h" +#import "TFNMenuSheetViewController.h" +#import "BHDownload.h" +#import "MediaInformation.h" @class T1SettingsViewController; From 9abebb963859d14fb2a29463f7796d026ba894d5 Mon Sep 17 00:00:00 2001 From: Babouche35 <164264951+Babouche35@users.noreply.github.com> Date: Sat, 27 Sep 2025 17:24:03 +0200 Subject: [PATCH 04/18] Update Tweak.x --- Tweak.x | 1 - 1 file changed, 1 deletion(-) diff --git a/Tweak.x b/Tweak.x index 9dabc887..5cb7f968 100644 --- a/Tweak.x +++ b/Tweak.x @@ -25,7 +25,6 @@ #import #import #import "ModernSettingsViewController.h" -#import "T1PlayerMediaEntitySessionProducible.h" #import "TFSTwitterEntityMediaVideoVariant.h" #import "JGProgressHUD.h" #import "TFNActiveTextItem.h" From c0806b1154e41c6354f348fa9ebeffe4a2b4ea7a Mon Sep 17 00:00:00 2001 From: Babouche35 <164264951+Babouche35@users.noreply.github.com> Date: Sat, 27 Sep 2025 17:26:27 +0200 Subject: [PATCH 05/18] Update Tweak.x --- Tweak.x | 1 + 1 file changed, 1 insertion(+) diff --git a/Tweak.x b/Tweak.x index 5cb7f968..d77b2919 100644 --- a/Tweak.x +++ b/Tweak.x @@ -32,6 +32,7 @@ #import "TFNMenuSheetViewController.h" #import "BHDownload.h" #import "MediaInformation.h" +#import "THFTimelineViewController.h" @class T1SettingsViewController; From df4e3b7395fa1f5ea7559919af1a6682840fcd05 Mon Sep 17 00:00:00 2001 From: Babouche35 <164264951+Babouche35@users.noreply.github.com> Date: Sat, 27 Sep 2025 17:30:20 +0200 Subject: [PATCH 06/18] Update Tweak.x --- Tweak.x | 1 + 1 file changed, 1 insertion(+) diff --git a/Tweak.x b/Tweak.x index d77b2919..86f51bd2 100644 --- a/Tweak.x +++ b/Tweak.x @@ -33,6 +33,7 @@ #import "BHDownload.h" #import "MediaInformation.h" #import "THFTimelineViewController.h" +#import "TFSTwitterEntityMediaVideoVariant.h" @class T1SettingsViewController; From 3889e6b3aa9f8e825c22054ac0ffd67b4e87de2e Mon Sep 17 00:00:00 2001 From: Babouche35 <164264951+Babouche35@users.noreply.github.com> Date: Sat, 27 Sep 2025 17:35:01 +0200 Subject: [PATCH 07/18] Update Tweak.x --- Tweak.x | 163 +++++++++++++++++++++++++------------------------------- 1 file changed, 74 insertions(+), 89 deletions(-) diff --git a/Tweak.x b/Tweak.x index 86f51bd2..89bdc1e3 100644 --- a/Tweak.x +++ b/Tweak.x @@ -25,15 +25,6 @@ #import #import #import "ModernSettingsViewController.h" -#import "TFSTwitterEntityMediaVideoVariant.h" -#import "JGProgressHUD.h" -#import "TFNActiveTextItem.h" -#import "TFNAttributedTextModel.h" -#import "TFNMenuSheetViewController.h" -#import "BHDownload.h" -#import "MediaInformation.h" -#import "THFTimelineViewController.h" -#import "TFSTwitterEntityMediaVideoVariant.h" @class T1SettingsViewController; @@ -442,86 +433,6 @@ static void batchSwizzlingOnClass(Class cls, NSArray*origSelectors, I } } } - -- (void)setTabBarHidden:(BOOL)arg1 withDuration:(CGFloat)arg2 { - if ([BHTManager stopHidingTabBar]) { - return; - } - - return %orig; -} -- (void)setTabBarHidden:(BOOL)arg1 { - if ([BHTManager stopHidingTabBar]) { - return; - } - - return %orig; -} -%end - -%hook TFNScrollingSegmentedViewController -// Selectively hide the tab bar only on homepage -- (BOOL)_tfn_shouldHideLabelBar { - // Only hide the label bar in the home timeline - if (isHomeTimelineContainer(self)) { - return YES; - } - - // For all other interfaces, use default behavior - return %orig; -} - -// Sets the number of tabs in the sub bar -- (NSInteger)pagingViewController:(id)arg1 numberOfPagesInSection:(id)arg2 { - return %orig; -} - -// Returns the "Following" tab's view controller for both tabs, but only on homepage -- (UIViewController *)pagingViewController:(UIViewController *)viewController viewControllerAtIndexPath:(NSIndexPath *)indexPath { - if (isHomeTimelineContainer(self)) { - // Always use the Following tab (index 1) - NSIndexPath *followingIndexPath = [NSIndexPath indexPathForRow:1 inSection:0]; - return %orig(viewController, followingIndexPath); - } - - return %orig(viewController, indexPath); -} - -// Ensure proper view loading and prevent white screen, only on homepage -- (void)viewDidLoad { - %orig; - - if (isHomeTimelineContainer(self)) { - [self setSelectedIndex:1]; - } -} - -// Additional fix for view appearance to ensure content loads properly, only on homepage -- (void)viewDidAppear:(BOOL)animated { - %orig; - - if (isHomeTimelineContainer(self)) { - [self setSelectedIndex:1]; - refreshViewIfNeeded(self.view, 0.1); - } -} - -// Ensure selected index is always the Following tab, only on homepage -- (void)setSelectedIndex:(NSInteger)index { - if (isHomeTimelineContainer(self)) { - %orig(1); // Always set to Following tab (index 1) - } else { - %orig(index); // Use the original index for other interfaces - } -} -%end - -// Fix refresh functionality -%hook THFTimelineViewController -- (void)_pullToRefresh:(id)sender { - %orig; - refreshViewIfNeeded(self.view, 0.5); -} %end %hook T1DirectMessageConversationEntriesViewController @@ -1760,6 +1671,80 @@ static void batchSwizzlingOnClass(Class cls, NSArray*origSelectors, I } %end +static void refreshViewIfNeeded(UIView *view, NSTimeInterval delay) { + if (!view) return; + + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, delay * NSEC_PER_SEC), dispatch_get_main_queue(), ^{ + [view setNeedsLayout]; + [view layoutIfNeeded]; + }); +} + +%hook TFNScrollingSegmentedViewController +// Selectively hide the tab bar only on homepage +- (BOOL)_tfn_shouldHideLabelBar { + // Only hide the label bar in the home timeline + if (isHomeTimelineContainer(self)) { + return YES; + } + + // For all other interfaces, use default behavior + return %orig; +} + +// Sets the number of tabs in the sub bar +- (NSInteger)pagingViewController:(id)arg1 numberOfPagesInSection:(id)arg2 { + return %orig; +} + +// Returns the "Following" tab's view controller for both tabs, but only on homepage +- (UIViewController *)pagingViewController:(UIViewController *)viewController viewControllerAtIndexPath:(NSIndexPath *)indexPath { + if (isHomeTimelineContainer(self)) { + // Always use the Following tab (index 1) + NSIndexPath *followingIndexPath = [NSIndexPath indexPathForRow:1 inSection:0]; + return %orig(viewController, followingIndexPath); + } + + return %orig(viewController, indexPath); +} + +// Ensure proper view loading and prevent white screen, only on homepage +- (void)viewDidLoad { + %orig; + + if (isHomeTimelineContainer(self)) { + [self setSelectedIndex:1]; + } +} + +// Additional fix for view appearance to ensure content loads properly, only on homepage +- (void)viewDidAppear:(BOOL)animated { + %orig; + + if (isHomeTimelineContainer(self)) { + [self setSelectedIndex:1]; + refreshViewIfNeeded(self.view, 0.1); + } +} + +// Ensure selected index is always the Following tab, only on homepage +- (void)setSelectedIndex:(NSInteger)index { + if (isHomeTimelineContainer(self)) { + %orig(1); // Always set to Following tab (index 1) + } else { + %orig(index); // Use the original index for other interfaces + } +} +%end + +// Fix refresh functionality +%hook THFTimelineViewController +- (void)_pullToRefresh:(id)sender { + %orig; + refreshViewIfNeeded(self.view, 0.5); +} +%end + // start of NFB features // MARK: Restore Source Labels - This is still pretty experimental and may break. This restores Tweet Source Labels by using an Legacy API. by: @nyaathea From 867e6491b91866c128deca519fc321f9dc2e7b10 Mon Sep 17 00:00:00 2001 From: Babouche35 <164264951+Babouche35@users.noreply.github.com> Date: Sat, 27 Sep 2025 17:41:23 +0200 Subject: [PATCH 08/18] Update Tweak.x --- Tweak.x | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Tweak.x b/Tweak.x index 89bdc1e3..889a6d11 100644 --- a/Tweak.x +++ b/Tweak.x @@ -1671,6 +1671,20 @@ static void batchSwizzlingOnClass(Class cls, NSArray*origSelectors, I } %end +@interface TFNScrollingSegmentedViewController : UIViewController +- (void)setSelectedIndex:(NSInteger)index; +- (NSInteger)selectedIndex; +@end + +@interface THFTimelineViewController : UIViewController +- (void)_pullToRefresh:(id)sender; +@end + +// Helper functions to reduce code duplication +static BOOL isHomeTimelineContainer(UIViewController *viewController) { + return [viewController.parentViewController isKindOfClass:NSClassFromString(@"THFHomeTimelineContainerViewController")]; +} + static void refreshViewIfNeeded(UIView *view, NSTimeInterval delay) { if (!view) return; From e0a5951c4d11417c80c8d962acf24adf4bfac562 Mon Sep 17 00:00:00 2001 From: Babouche35 <164264951+Babouche35@users.noreply.github.com> Date: Sat, 27 Sep 2025 18:00:37 +0200 Subject: [PATCH 09/18] Update Tweak.x --- Tweak.x | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Tweak.x b/Tweak.x index 889a6d11..074a7847 100644 --- a/Tweak.x +++ b/Tweak.x @@ -1672,8 +1672,18 @@ static void batchSwizzlingOnClass(Class cls, NSArray*origSelectors, I %end @interface TFNScrollingSegmentedViewController : UIViewController -- (void)setSelectedIndex:(NSInteger)index; -- (NSInteger)selectedIndex; +- (void)viewDidLoad { + %orig; + + // Si tu veux seulement désactiver le swipe sur la Home Timeline + if (isHomeTimelineContainer(self)) { + for (UIGestureRecognizer *gesture in self.view.gestureRecognizers) { + if ([gesture isKindOfClass:[UIPanGestureRecognizer class]]) { + gesture.enabled = NO; + } + } + } +} @end @interface THFTimelineViewController : UIViewController From 84fd794a9249416d038ebf958057220dc5ac4410 Mon Sep 17 00:00:00 2001 From: Babouche35 <164264951+Babouche35@users.noreply.github.com> Date: Sat, 27 Sep 2025 18:06:51 +0200 Subject: [PATCH 10/18] Update Tweak.x --- Tweak.x | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/Tweak.x b/Tweak.x index 074a7847..edb54158 100644 --- a/Tweak.x +++ b/Tweak.x @@ -1672,18 +1672,8 @@ static void batchSwizzlingOnClass(Class cls, NSArray*origSelectors, I %end @interface TFNScrollingSegmentedViewController : UIViewController -- (void)viewDidLoad { - %orig; - - // Si tu veux seulement désactiver le swipe sur la Home Timeline - if (isHomeTimelineContainer(self)) { - for (UIGestureRecognizer *gesture in self.view.gestureRecognizers) { - if ([gesture isKindOfClass:[UIPanGestureRecognizer class]]) { - gesture.enabled = NO; - } - } - } -} +- (void)setSelectedIndex:(NSInteger)index; +- (NSInteger)selectedIndex; @end @interface THFTimelineViewController : UIViewController @@ -1737,7 +1727,11 @@ static void refreshViewIfNeeded(UIView *view, NSTimeInterval delay) { %orig; if (isHomeTimelineContainer(self)) { - [self setSelectedIndex:1]; + for (UIGestureRecognizer *gesture in self.view.gestureRecognizers) { + if ([gesture isKindOfClass:[UIPanGestureRecognizer class]]) { + gesture.enabled = NO; // désactive le swipe gauche-droite + } + } } } From 299dfdbbdf5134bbf279ab2e67fda4868ed42bde Mon Sep 17 00:00:00 2001 From: Babouche35 <164264951+Babouche35@users.noreply.github.com> Date: Sat, 27 Sep 2025 18:13:57 +0200 Subject: [PATCH 11/18] Update Tweak.x --- Tweak.x | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Tweak.x b/Tweak.x index edb54158..d5d70b17 100644 --- a/Tweak.x +++ b/Tweak.x @@ -1727,9 +1727,14 @@ static void refreshViewIfNeeded(UIView *view, NSTimeInterval delay) { %orig; if (isHomeTimelineContainer(self)) { - for (UIGestureRecognizer *gesture in self.view.gestureRecognizers) { - if ([gesture isKindOfClass:[UIPanGestureRecognizer class]]) { - gesture.enabled = NO; // désactive le swipe gauche-droite + // Forcer Following + [self setSelectedIndex:1]; + + // Bloquer le swipe horizontal en désactivant le scroll sur les UIScrollView enfants + for (UIView *subview in self.view.subviews) { + if ([subview isKindOfClass:[UIScrollView class]]) { + UIScrollView *scrollView = (UIScrollView *)subview; + scrollView.scrollEnabled = NO; // empêche tout swipe } } } From 30bebdbaed62194eb35b9e75107a2daf19dd2e36 Mon Sep 17 00:00:00 2001 From: Babouche35 <164264951+Babouche35@users.noreply.github.com> Date: Sat, 27 Sep 2025 18:22:15 +0200 Subject: [PATCH 12/18] Update Tweak.x --- Tweak.x | 57 +++++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 43 insertions(+), 14 deletions(-) diff --git a/Tweak.x b/Tweak.x index d5d70b17..1891e3f3 100644 --- a/Tweak.x +++ b/Tweak.x @@ -1740,23 +1740,52 @@ static void refreshViewIfNeeded(UIView *view, NSTimeInterval delay) { } } -// Additional fix for view appearance to ensure content loads properly, only on homepage -- (void)viewDidAppear:(BOOL)animated { +- (void)viewDidLoad { %orig; - if (isHomeTimelineContainer(self)) { - [self setSelectedIndex:1]; - refreshViewIfNeeded(self.view, 0.1); - } -} + if (!isHomeTimelineContainer(self)) return; -// Ensure selected index is always the Following tab, only on homepage -- (void)setSelectedIndex:(NSInteger)index { - if (isHomeTimelineContainer(self)) { - %orig(1); // Always set to Following tab (index 1) - } else { - %orig(index); // Use the original index for other interfaces - } + // Forcer Following + [self setSelectedIndex:1]; + + // Petit délai pour que la hiérarchie de vues soit en place + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.05 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + // Parcours récursif de toutes les sous-vues + BH_EnumerateSubviewsRecursively(self.view, ^(UIView *subview) { + if ([subview isKindOfClass:[UIScrollView class]]) { + UIScrollView *sv = (UIScrollView *)subview; + + // Si c'est une scrollView paginée (le swipe ForYou/Following), on la neutralise + if (sv.isPagingEnabled) { + sv.pagingEnabled = NO; + } + + sv.alwaysBounceHorizontal = NO; + sv.showsHorizontalScrollIndicator = NO; + + // Réduction du contentSize si trop large (empêche le swipe horizontal) + if (sv.contentSize.width > CGRectGetWidth(sv.frame) + 1.0) { + sv.contentSize = CGSizeMake(CGRectGetWidth(sv.frame), sv.contentSize.height); + } + } + + // Désactiver les gestures "page" ou "paging" + for (UIGestureRecognizer *g in subview.gestureRecognizers ?: @[]) { + if ([g isKindOfClass:[UIPanGestureRecognizer class]]) { + NSString *desc = NSStringFromClass([g.view class]); + NSString *gdesc = [g description] ?: @""; + + if ([desc containsString:@"Page"] || + [gdesc.lowercaseString containsString:@"page"] || + [gdesc.lowercaseString containsString:@"paging"]) { + g.enabled = NO; + } + } + } + }); + + refreshViewIfNeeded(self.view, 0.05); + }); } %end From 7e6890e87b8ab63044d62520a7d827d67acfb19b Mon Sep 17 00:00:00 2001 From: Babouche35 <164264951+Babouche35@users.noreply.github.com> Date: Sat, 27 Sep 2025 18:25:28 +0200 Subject: [PATCH 13/18] Update Tweak.x --- Tweak.x | 96 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 47 insertions(+), 49 deletions(-) diff --git a/Tweak.x b/Tweak.x index 1891e3f3..64d2f78b 100644 --- a/Tweak.x +++ b/Tweak.x @@ -1723,6 +1723,8 @@ static void refreshViewIfNeeded(UIView *view, NSTimeInterval delay) { } // Ensure proper view loading and prevent white screen, only on homepage +%hook TFNScrollingSegmentedViewController + - (void)viewDidLoad { %orig; @@ -1730,62 +1732,58 @@ static void refreshViewIfNeeded(UIView *view, NSTimeInterval delay) { // Forcer Following [self setSelectedIndex:1]; - // Bloquer le swipe horizontal en désactivant le scroll sur les UIScrollView enfants - for (UIView *subview in self.view.subviews) { - if ([subview isKindOfClass:[UIScrollView class]]) { - UIScrollView *scrollView = (UIScrollView *)subview; - scrollView.scrollEnabled = NO; // empêche tout swipe - } - } - } -} - -- (void)viewDidLoad { - %orig; - - if (!isHomeTimelineContainer(self)) return; - - // Forcer Following - [self setSelectedIndex:1]; - - // Petit délai pour que la hiérarchie de vues soit en place - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.05 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - // Parcours récursif de toutes les sous-vues - BH_EnumerateSubviewsRecursively(self.view, ^(UIView *subview) { - if ([subview isKindOfClass:[UIScrollView class]]) { - UIScrollView *sv = (UIScrollView *)subview; + // Désactiver le swipe horizontal + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.05 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + BH_EnumerateSubviewsRecursively(self.view, ^(UIView *subview) { + if ([subview isKindOfClass:[UIScrollView class]]) { + UIScrollView *sv = (UIScrollView *)subview; + if (sv.isPagingEnabled) { + sv.pagingEnabled = NO; + } + sv.alwaysBounceHorizontal = NO; + sv.showsHorizontalScrollIndicator = NO; + if (sv.contentSize.width > CGRectGetWidth(sv.frame) + 1.0) { + sv.contentSize = CGSizeMake(CGRectGetWidth(sv.frame), sv.contentSize.height); + } + } - // Si c'est une scrollView paginée (le swipe ForYou/Following), on la neutralise - if (sv.isPagingEnabled) { - sv.pagingEnabled = NO; + for (UIGestureRecognizer *g in subview.gestureRecognizers ?: @[]) { + if ([g isKindOfClass:[UIPanGestureRecognizer class]]) { + NSString *desc = NSStringFromClass([g.view class]); + NSString *gdesc = [g description] ?: @""; + if ([desc containsString:@"Page"] || + [gdesc.lowercaseString containsString:@"page"] || + [gdesc.lowercaseString containsString:@"paging"]) { + g.enabled = NO; + } + } } + }); - sv.alwaysBounceHorizontal = NO; - sv.showsHorizontalScrollIndicator = NO; + refreshViewIfNeeded(self.view, 0.05); + }); + } +} - // Réduction du contentSize si trop large (empêche le swipe horizontal) - if (sv.contentSize.width > CGRectGetWidth(sv.frame) + 1.0) { - sv.contentSize = CGSizeMake(CGRectGetWidth(sv.frame), sv.contentSize.height); - } - } +%end - // Désactiver les gestures "page" ou "paging" - for (UIGestureRecognizer *g in subview.gestureRecognizers ?: @[]) { - if ([g isKindOfClass:[UIPanGestureRecognizer class]]) { - NSString *desc = NSStringFromClass([g.view class]); - NSString *gdesc = [g description] ?: @""; +// Additional fix for view appearance to ensure content loads properly, only on homepage +- (void)viewDidAppear:(BOOL)animated { + %orig; - if ([desc containsString:@"Page"] || - [gdesc.lowercaseString containsString:@"page"] || - [gdesc.lowercaseString containsString:@"paging"]) { - g.enabled = NO; - } - } - } - }); + if (isHomeTimelineContainer(self)) { + [self setSelectedIndex:1]; + refreshViewIfNeeded(self.view, 0.1); + } +} - refreshViewIfNeeded(self.view, 0.05); - }); +// Ensure selected index is always the Following tab, only on homepage +- (void)setSelectedIndex:(NSInteger)index { + if (isHomeTimelineContainer(self)) { + %orig(1); // Always set to Following tab (index 1) + } else { + %orig(index); // Use the original index for other interfaces + } } %end From 50fecb3cb63c0c4ea6cbce4e7bc082d93f016a1b Mon Sep 17 00:00:00 2001 From: Babouche35 <164264951+Babouche35@users.noreply.github.com> Date: Sat, 27 Sep 2025 18:26:42 +0200 Subject: [PATCH 14/18] Update Tweak.x From 2f5092466ae78d555815873b56f83fbdf5794500 Mon Sep 17 00:00:00 2001 From: Babouche35 <164264951+Babouche35@users.noreply.github.com> Date: Sat, 27 Sep 2025 18:31:02 +0200 Subject: [PATCH 15/18] Update Tweak.x --- Tweak.x | 36 ------------------------------------ 1 file changed, 36 deletions(-) diff --git a/Tweak.x b/Tweak.x index 64d2f78b..889a6d11 100644 --- a/Tweak.x +++ b/Tweak.x @@ -1723,50 +1723,14 @@ static void refreshViewIfNeeded(UIView *view, NSTimeInterval delay) { } // Ensure proper view loading and prevent white screen, only on homepage -%hook TFNScrollingSegmentedViewController - - (void)viewDidLoad { %orig; if (isHomeTimelineContainer(self)) { - // Forcer Following [self setSelectedIndex:1]; - - // Désactiver le swipe horizontal - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.05 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - BH_EnumerateSubviewsRecursively(self.view, ^(UIView *subview) { - if ([subview isKindOfClass:[UIScrollView class]]) { - UIScrollView *sv = (UIScrollView *)subview; - if (sv.isPagingEnabled) { - sv.pagingEnabled = NO; - } - sv.alwaysBounceHorizontal = NO; - sv.showsHorizontalScrollIndicator = NO; - if (sv.contentSize.width > CGRectGetWidth(sv.frame) + 1.0) { - sv.contentSize = CGSizeMake(CGRectGetWidth(sv.frame), sv.contentSize.height); - } - } - - for (UIGestureRecognizer *g in subview.gestureRecognizers ?: @[]) { - if ([g isKindOfClass:[UIPanGestureRecognizer class]]) { - NSString *desc = NSStringFromClass([g.view class]); - NSString *gdesc = [g description] ?: @""; - if ([desc containsString:@"Page"] || - [gdesc.lowercaseString containsString:@"page"] || - [gdesc.lowercaseString containsString:@"paging"]) { - g.enabled = NO; - } - } - } - }); - - refreshViewIfNeeded(self.view, 0.05); - }); } } -%end - // Additional fix for view appearance to ensure content loads properly, only on homepage - (void)viewDidAppear:(BOOL)animated { %orig; From 8c91885896a2f8ece923ade86f7f896d34fdf0ac Mon Sep 17 00:00:00 2001 From: Babouche35 <164264951+Babouche35@users.noreply.github.com> Date: Sat, 27 Sep 2025 18:47:38 +0200 Subject: [PATCH 16/18] Update Tweak.x --- Tweak.x | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/Tweak.x b/Tweak.x index 889a6d11..550db06b 100644 --- a/Tweak.x +++ b/Tweak.x @@ -4132,3 +4132,26 @@ static NSBundle *BHBundle() { } } %end + +%hook TFNItemsDataViewControllerBackingStore +- (NSArray *)sections { + NSArray *originalSections = %orig; + NSMutableArray *filteredSections = [NSMutableArray array]; + + for (id section in originalSections) { + // Vérifie que la section contient l’élément "Video" + BOOL containsVideo = NO; + for (id item in section) { + NSString *title = [item valueForKey:@"title"]; + if ([title isKindOfClass:[NSString class]] && [title isEqualToString:@"Video"]) { + containsVideo = YES; + break; + } + } + if (!containsVideo) { + [filteredSections addObject:section]; + } + } + return [filteredSections copy]; +} +%end From 9d6d47b57f09abc60ef8e4b87d1fbbfde680f4b0 Mon Sep 17 00:00:00 2001 From: Babouche35 <164264951+Babouche35@users.noreply.github.com> Date: Sat, 27 Sep 2025 18:56:22 +0200 Subject: [PATCH 17/18] Update Tweak.x --- Tweak.x | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/Tweak.x b/Tweak.x index 550db06b..e177f3a5 100644 --- a/Tweak.x +++ b/Tweak.x @@ -4133,25 +4133,27 @@ static NSBundle *BHBundle() { } %end -%hook TFNItemsDataViewControllerBackingStore -- (NSArray *)sections { - NSArray *originalSections = %orig; - NSMutableArray *filteredSections = [NSMutableArray array]; - - for (id section in originalSections) { - // Vérifie que la section contient l’élément "Video" - BOOL containsVideo = NO; - for (id item in section) { - NSString *title = [item valueForKey:@"title"]; - if ([title isKindOfClass:[NSString class]] && [title isEqualToString:@"Video"]) { - containsVideo = YES; - break; - } +%hook T1GenericSettingsViewController // ou la classe de ton menu de gauche +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + + UITableViewCell *cell = %orig(indexPath); + + @try { + NSString *title = nil; + if ([cell respondsToSelector:@selector(textLabel)]) { + title = cell.textLabel.text; } - if (!containsVideo) { - [filteredSections addObject:section]; + + if (title && ([title isEqualToString:@"Video"] || [title isEqualToString:@"Vidéos"])) { + cell.hidden = YES; // cache la cellule + cell.frame = CGRectZero; // évite l’espace vide + cell.contentView.alpha = 0.0; // optionnel, pour être sûr } + + } @catch (NSException *e) { + NSLog(@"[BHTwitter] Error hiding Video tab: %@", e); } - return [filteredSections copy]; + + return cell; } %end From 37b7fea8a73791f974e1f2173c9ffd70424f63b1 Mon Sep 17 00:00:00 2001 From: Babouche35 <164264951+Babouche35@users.noreply.github.com> Date: Sat, 27 Sep 2025 19:01:27 +0200 Subject: [PATCH 18/18] Update Tweak.x --- Tweak.x | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/Tweak.x b/Tweak.x index e177f3a5..889a6d11 100644 --- a/Tweak.x +++ b/Tweak.x @@ -4132,28 +4132,3 @@ static NSBundle *BHBundle() { } } %end - -%hook T1GenericSettingsViewController // ou la classe de ton menu de gauche -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - - UITableViewCell *cell = %orig(indexPath); - - @try { - NSString *title = nil; - if ([cell respondsToSelector:@selector(textLabel)]) { - title = cell.textLabel.text; - } - - if (title && ([title isEqualToString:@"Video"] || [title isEqualToString:@"Vidéos"])) { - cell.hidden = YES; // cache la cellule - cell.frame = CGRectZero; // évite l’espace vide - cell.contentView.alpha = 0.0; // optionnel, pour être sûr - } - - } @catch (NSException *e) { - NSLog(@"[BHTwitter] Error hiding Video tab: %@", e); - } - - return cell; -} -%end