Repository navigation
iOS: Fix bottom tabs visibility on iOS 18 #8363
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
Changes from 1 commit
d85127c
7e55ccc
c191ae4
ebf7bfd
cbb900d
136166d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,6 +20,8 @@ | |
|
|
||
| - (void)hideTabBar:(BOOL)animated; | ||
|
|
||
| - (BOOL)rnn_isTabBarHidden; | ||
|
|
||
| - (void)syncTabBarItemTestIDs; | ||
|
|
||
| @end | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -161,6 +161,33 @@ - (void)testGetCurrentChild_shouldReturnSelectedViewController { | |
| [(RNNBottomTabsController *)self.uut selectedViewController]); | ||
| } | ||
|
|
||
| - (void)testSetTabBarVisible_shouldUseActiveTabBarVisibilityOnIOS18 { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. None of the coverage added for this fix actually runs on an iOS 18+ runtime in CI, from either direction:
So the suite that runs on a modern OS doesn't exercise this, and the tests that exercise it don't run on a modern OS. An e2e case on the new repro screen asserting the tab bar stays hidden looks like the cheapest fix, since that job is already on iOS 26. Bumping the unit-test destination to iOS 18+ would work too, though it changes what the whole suite verifies. |
||
| if (@available(iOS 18.0, *)) { | ||
| [self.originalUut setTabBarVisible:NO]; | ||
| XCTAssertTrue(self.originalUut.tabBarHidden); | ||
|
|
||
| [self.originalUut setTabBarVisible:YES]; | ||
| XCTAssertFalse(self.originalUut.tabBarHidden); | ||
| } | ||
| } | ||
|
|
||
| - (void)testSetTabBarVisible_shouldNotOverrideStackChildVisibilityOnIOS18 { | ||
| if (@available(iOS 18.0, *)) { | ||
| UIViewController *component = | ||
| [RNNComponentViewController createWithComponentId:@"componentId" | ||
| initialOptions:[RNNNavigationOptions emptyOptions]]; | ||
| UINavigationController *stack = | ||
| [[UINavigationController alloc] initWithRootViewController:component]; | ||
| RNNBottomTabsController *uut = | ||
| [RNNBottomTabsController createWithChildren:@[ stack ]]; | ||
|
|
||
| [uut setTabBarHidden:NO animated:NO]; | ||
| [uut setTabBarVisible:NO]; | ||
|
|
||
| XCTAssertFalse(uut.tabBarHidden); | ||
| } | ||
| } | ||
|
|
||
| - (void)testPreferredStatusBarStyle_shouldInvokeSelectedViewControllerPreferredStatusBarStyle { | ||
| [[self.mockTabBarPresenter expect] getStatusBarStyle]; | ||
| [self.uut preferredStatusBarStyle]; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This calls UIKit's
setTabBarHidden:animated:directly rather than going throughshowTabBar:/hideTabBar:like every other visibility path in the controller, so the initial application skips_tabBarNeedsRestorebookkeeping and the custom-row sync. Routing it through the category helpers would keep a single code path for visibility changes.