#1

iPad support for SwiftUI previews

OpenInterlap01opened 1mo ago

What

SwiftUI previews render iPhone portrait only. iPad apps should preview as iPad: the right screen sizes, the regular width and height size classes, and the iPad forms of the system controls.

Why

A tablet-only or universal app cannot be previewed honestly today. Apps that branch on the size class get the phone layout, and split-view apps do not render at all.

Scope

First cut: iPad renders in its compact-width shapes.

  • ipad-pro-11 and ipad-pro-13 profiles, portrait and landscape, with the iPad status bar and safe areas.
  • Size classes and the device idiom follow the profile, so an app's horizontalSizeClass and UIDevice checks take their iPad branch.
  • Wide-screen margins for Form and List section cards.
  • Sheets present as centred form sheets; fullScreenCover stays full screen.
  • Popovers and confirmation dialogs present as anchored popovers.
  • The width assumptions in the semantic tree and paint pipeline scale with the profile.
  • Default profile stays iPhone; --profile ipad-pro-11 selects the iPad.

Full cut: iPad layouts that are not a wide phone.

  • NavigationSplitView with two columns, each with its own title, toolbar and back state; three columns and columnVisibility after that.
  • Tab bar placement: the top strip on iOS 18 and later, the centred bottom bar on 17.
  • Landscape-specific chrome (tab labels beside icons).
  • iPad reference captures for the benchmark screens, so fidelity is scored on iPad too.
  • Docs and the agent skill mention the iPad profiles.

Notes

  • No hard blockers were found in the assessment. The large item is the split view: today every piece of navigation chrome state assumes one column.
  • Related fix shipping separately: iPhone previews currently report the regular width size class to the app. The engine will set compact width and regular height for phone profiles.

Acceptance

  • The IceCubes settings screens (Settings, Display, Add Account, Acknowledgements) preview on ipad-pro-11 in both orientations and match an iPad simulator on the benchmark score.
  • An app using NavigationSplitView previews with the sidebar and detail both in the tree and tappable.
  • The existing iPhone benchmark is unchanged.

Activity

0

No activity yet.