We use a custom animated tab selector inside the content (matched geometry, per-tab animations) rather than a TabView. On iPhone Duo, is the recommended path to migrate to TabView, or can a custom control like this join the vertical bar via a ToolbarItem with .axisBehavior(.verticalPreferred)? Does such an item get enough height for five or six segments?
Hi @ClementGzl,
When developing for iOS, consider using system-provided containers like TabView or UITabBarController rather than custom controls. System components automatically handle layout adaptations, such as moving to a vertical bar on the side of the display on iPhone Duo.
While custom tab selectors can be built using matched geometry effects, migrating to TabView ensures native behavior, such as animated label reveals and proper touch handling during vertical bar presentations.
To allow a custom control to join a vertical bar, place it inside a ToolbarItem and apply the axisBehavior(_:) modifier. Use .verticalPreferred to specify that the item supports both horizontal and vertical bars, preferring a vertical placement when both are present.
The system dynamically determines the available space for vertical bars based on the window size and surrounding interface elements. If space is constrained or too many items are present, additional items may be placed in an overflow menu.
Attempting to fit five or six distinct custom segments vertically within a standard toolbar item on a compact device height can lead to severe space constraints and touch target accessibility issues. Consider using a standard TabView or sidebar configuration instead.
Cheers,
Paris X Pinkney | WWDR | DTS Engineer