Repository navigation
ResponsiveLayoutKit 0.5 moves from the 0.4 phone/tablet model to Apple's
vocabulary (size classes and scene geometry) and supports every form factor:
iPhone, iPad, iPhone Duo, Mac, Mac Catalyst, and Apple Vision Pro. Nothing
breaks: every 0.4 API is still there, deprecated, and behaves as in 0.4.0.
See Migrating from Phone and Tablet Layouts
for the replacement table and before/after examples.
Added
- macOS, visionOS, and Mac Catalyst support. Platforms are now iOS 26,
macOS 26, visionOS 26, and Mac Catalyst 26. UserInterfaceSizeClass.value(compact:regular:), also on the optional, so
Apple's\.horizontalSizeClassworks directly.nilresolves to.compact,
or.regularon native macOS.\.sceneHorizontalSizeClassand\.sceneVerticalSizeClass: non-optional
scene-scope size classes that don't flip inside a compact sheet or popover.
Resolution order: the nearest write (an explicit write and the value an
anchor or mock publishes share one storage, so the nearer one wins), the
container's size class, then the platform default.SceneGeometry: a per-scene@Observable, read with
@Environment(SceneGeometry.self). It exposessize,safeAreaInsets,
horizontalSizeClass,verticalSizeClass,isLandscapeAspectRatio,
interfaceOrientation(unavailable on native macOS),hinge,hingeStatus,
andreservedRegions(kind:options:in:). It is nevernilunder an anchor
and updates in place.@Environment(SceneGeometry.self) private var scene: SceneGeometry?is the optional form for shared components that can't
guarantee an anchor.safeAreaInsetsfollow the layout direction: in a
right-to-left layout,leadingis the physical right edge.sceneGeometryAnchor(): installsSceneGeometryat the scene root. It
discovers theUIWindowScene(iOS, visionOS, Catalyst) orNSWindow
(macOS), and also publishes the 0.4\.sceneLayoutvalue so old and new
code share one anchor.- iPhone Duo and hinge support on iOS 27.1 and later: the
Responsive
namespace mirrors Apple'sDeviceHingeandReservedRegionas
Responsive.DeviceHingeandResponsive.ReservedRegion, so the same code
compiles on iOS 26.hingeisnilon devices without one, on iOS 26, and
on external displays. The anchor reports the hinge's pose from launch. readableContentWidth(_:): caps scroll content at a fraction of the scene
width (default0.66) on regular widths. Across a vertical fold it lifts the
cap so content spans both halves; configure this with
readableContentWidthDivisionBehavior(_:)and
ReadableContentWidthDivisionBehavior(.automatic,.expand,.ignore).SceneGeometry.Mock,sceneGeometry(mocking:), and the
.sceneGeometry(mocking:)preview trait. Mocks set the scene geometry and
both Apple and scene size classes, and take a hinge and reserved regions in
scene coordinates. Presets:.phone(_:),.pad(_:),.foldablePhone(_:)
(iPhone Duo poses.closed,.open(.tall/.wide),
.partiallyOpen(.book/.laptop)),.mac(size:), and.vision. Foldable
numbers are measured in the Xcode 27.2 Device Hub simulator.- DocC articles: Designing for Every Form Factor, Scene Geometry, Previews
and Testing, and Migrating from Phone and Tablet Layouts. - Demo app is multiplatform (iOS, macOS, visionOS), with fold,
readable-width, and preset gallery pages.
Changed
accessibilityScrollView(_:)andaccessibilityScrollFloor(_:)keep their
API, now read the window height fromSceneGeometry, and work on every
platform.- Building requires Xcode 27.2 or later.
- README, DocC landing page, and the bundled Claude Code skill
(responsivelayoutkit) are rewritten for the 0.5 API, with references for
iPhone Duo poses and migration. Plugin bumped to 2.0.0. - CI runs on
xcode-27runners with a multiplatform matrix: tests on macOS
and the iPhone simulator, builds for visionOS and Mac Catalyst. The iPad
simulator job is dropped.
Deprecated
Every 0.4 API is deprecated, keeps its 0.4.0 behavior, never gains iPhone Duo
behavior, and will be removed in 1.0. The 0.4 APIs are available only on iOS,
iPadOS, and Mac Catalyst, where 0.4 ran.
ResponsiveLayout,value(phone:tablet:), and the layout ratios: use
UserInterfaceSizeClassandvalue(compact:regular:).LayoutContext: use\.horizontalSizeClass(container) or
\.sceneHorizontalSizeClass(scene).ResponsiveView(in:phone:tablet:)and.responsive(in:content:): read the
size class from the environment and branch or apply modifiers directly..responsiveLayout(_:)and\.responsiveLayoutOverride: use
.environment(\.sceneHorizontalSizeClass, …), or\.horizontalSizeClass
when system containers should change too.\.containerResponsiveLayout: use\.horizontalSizeClass.\.responsiveLayout: use\.sceneHorizontalSizeClass.\.sceneLayout,SceneLayoutEnvironment, andSceneLayoutReader: use
@Environment(SceneGeometry.self)..sceneLayoutAnchor(): renamed tosceneGeometryAnchor()(Xcode offers a
fix-it).SceneLayoutMockValuesand.sceneLayout(mocking:): use
SceneGeometry.MockandsceneGeometry(mocking:)..responsiveContentWidth(tabletFraction:): usereadableContentWidth(_:),
which differs only across a vertical fold on iPhone Duo.