[iPadOS 18] Force a bottom tab bar design on iPadOS 18 when built with Xcode 16 #14136
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context: peaMlT-SO-p2
Analysis: pdfdoF-5pI-p2 and pdfdoF-5w7-p2
Description
After building the app on iPadOS 18 with a new Xcode 16, the app automatically adopts a new top tab bar design. It results in layout issues and crashes within the app. The analysis has shown that it will take more effort than anticipated to properly support new APIs or switch to a sidebar.
Solution
Apple doesn't provide an official way to opt out of this change, however, other developers have discovered a workaround of setting
UITabBarController
trait collection to.compact
to force it to use the same bottom tab bar layout as iPhone. I didn't have high confidence in this change but discovered in the process that PocketCasts has been using it without any issues for a few weeks: Automattic/pocket-casts-ios#2077 (see discussion p1729084994494889-slack-C029BMLUGRX).The change forces the tab bar controller to use
.compact
trait collection while retaining a default trait collection for child view controllers.Testing information
I tested the app in 4 different modes:
I tested:
If we see no issues in the scope of this PR, I suggest we merge this since this code is not run when built with Xcode 15. We could then enable Xcode 16 on the CI, and run comprehensive end-to-end tests in that process to see if we're ready to make this switch.
Screenshots
RELEASE-NOTES.txt
if necessary.Reviewer (or Author, in the case of optional code reviews):
Please make sure these conditions are met before approving the PR, or request changes if the PR needs improvement: