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

[iPadOS 18] Force a bottom tab bar design on iPadOS 18 when built with Xcode 16 #14136

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

staskus
Copy link
Collaborator

@staskus staskus commented Oct 16, 2024

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:

  • iPadOS 18 + Xcode 16 (should be forced into a bottom tab bar layout with no issues)
  • iPadOS 18 + Xcode 15 (shouldn't be affected)
  • iPadOS 17 + Xcode 16 (shouldn't be affected)
  • iPadOS 17 + Xcode 15 (shouldn't be affected)

I tested:

  • Vertical/horizontal switches
  • Split view mode
  • Navigating through tabs (My Store, Orders, Products, Menu)
  • Collecting payment and doing other navigation through home screen icon
  • ....

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

image
  • I have considered if this change warrants user-facing release notes and have added them to 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:

  • The PR is small and has a clear, single focus, or a valid explanation is provided in the description. If needed, please request to split it into smaller PRs.
  • Ensure Adequate Unit Test Coverage: The changes are reasonably covered by unit tests or an explanation is provided in the PR description.
  • Manual Testing: The author listed all the tests they ran, including smoke tests when needed (e.g., for refactorings). The reviewer confirmed that the PR works as expected on all devices (phone/tablet) and no regressions are added.

@staskus staskus added type: task An internally driven task. iOS 18 labels Oct 16, 2024
@staskus staskus added this to the 20.9 milestone Oct 16, 2024
@wpmobilebot
Copy link
Collaborator

WooCommerce iOS📲 You can test the changes from this Pull Request in WooCommerce iOS by scanning the QR code below to install the corresponding build.

App NameWooCommerce iOS WooCommerce iOS
Build Numberpr14136-7ec9e87
Version20.7
Bundle IDcom.automattic.alpha.woocommerce
Commit7ec9e87
App Center BuildWooCommerce - Prototype Builds #11164
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@staskus
Copy link
Collaborator Author

staskus commented Oct 18, 2024

👋 @jaclync, @iamgabrielma, @joshheald, @toupper, @selanthiraiyan all the reviews are not required but I'm tagging you for awareness.

Given any change to accommodate a new tab bar requires at least a small project, we would like to postpone that while unblocking Xcode 16 in the process. See more context here peaMlT-SO-p2#comment-2401 The PocketCasts iOS app is using this approach in production without issues so far, it also works for me as well.

Merging this will not change anything in production until we enable Xcode 16 in the CI.

@jaclync jaclync self-assigned this Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
iOS 18 type: task An internally driven task.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants