Skip to content

0.5.0

Latest

Choose a tag to compare

@KalebCooper KalebCooper released this 01 Nov 22:19

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 \.horizontalSizeClass works directly. nil resolves to .compact,
    or .regular on native macOS.
  • \.sceneHorizontalSizeClass and \.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 exposes size, safeAreaInsets,
    horizontalSizeClass, verticalSizeClass, isLandscapeAspectRatio,
    interfaceOrientation (unavailable on native macOS), hinge, hingeStatus,
    and reservedRegions(kind:options:in:). It is never nil under 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. safeAreaInsets follow the layout direction: in a
    right-to-left layout, leading is the physical right edge.
  • sceneGeometryAnchor(): installs SceneGeometry at the scene root. It
    discovers the UIWindowScene (iOS, visionOS, Catalyst) or NSWindow
    (macOS), and also publishes the 0.4 \.sceneLayout value so old and new
    code share one anchor.
  • iPhone Duo and hinge support on iOS 27.1 and later: the Responsive
    namespace mirrors Apple's DeviceHinge and ReservedRegion as
    Responsive.DeviceHinge and Responsive.ReservedRegion, so the same code
    compiles on iOS 26. hinge is nil on 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 (default 0.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(_:) and accessibilityScrollFloor(_:) keep their
    API, now read the window height from SceneGeometry, 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-27 runners 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
    UserInterfaceSizeClass and value(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, and SceneLayoutReader: use
    @Environment(SceneGeometry.self).
  • .sceneLayoutAnchor(): renamed to sceneGeometryAnchor() (Xcode offers a
    fix-it).
  • SceneLayoutMockValues and .sceneLayout(mocking:): use
    SceneGeometry.Mock and sceneGeometry(mocking:).
  • .responsiveContentWidth(tabletFraction:): use readableContentWidth(_:),
    which differs only across a vertical fold on iPhone Duo.