Skip to content
OpenAgentSkill
Browsing is open · Catalog captured 2026-11-21 · Automatic updates and account services are paused.
Design & UI

duo-patterns

Picks and builds layout patterns for iPhone Duo, Apple's foldable iPhone, in SwiftUI - list-detail, supporting pane, two-page, dual view, extended canvas, feed reflow with even columns, tabs to sidebar, and displacement off the fold. Use it when you design or fix a screen for the outer display and the inner display, when content or buttons land in the fold, or when choosing between NavigationSplitView, inspector, ArrangementView (split and overlay styles), TabView with sidebarAdaptable and defaultTabBarPlacement, and reserved regions (division, occlusion, includeInactive).

Kimeur · Static checks on file

Installation

Read the source and dependencies before running a command. Copying does not install or execute anything.

npx skills add Kimeur/duology --skill duo-patterns

About this skill


name: duo-patterns description: Picks and builds layout patterns for iPhone Duo, Apple's foldable iPhone, in SwiftUI - list-detail, supporting pane, two-page, dual view, extended canvas, feed reflow with even columns, tabs to sidebar, and displacement off the fold. Use it when you design or fix a screen for the outer display and the inner display, when content or buttons land in the fold, or when choosing between NavigationSplitView, inspector, ArrangementView (split and overlay styles), TabView with sidebarAdaptable and defaultTabBarPlacement, and reserved regions (division, occlusion, includeInactive). metadata: verified: "Xcode 27.1 (27A9275), iOS 27.1 simulator, device: no" sources: "https://github.com/Kimeur/duology/blob/main/reference/sources.md"

Duo layout patterns

Use this skill to choose a layout pattern for a screen on iPhone Duo, then build it. Every pattern has a reference file with when to use it, closed and open behaviour, the Apple APIs, rules, pitfalls, a SwiftUI recipe that typechecks against the iOS 27.1 SDK, and a screen in the Duology gallery app.

Read the reference for the pattern you pick before you write code. For bars and toolbars, load duo-navigation. For size classes, safe areas and UIKit layout depth, load duo-layout. For keeping state through a fold, load duo-continuity.

Ground rules for every pattern

  1. Design for two size classes, not for poses. Compact width for the outer display, regular width for the inner display. Let the layout grow; don't design one layout per way of holding the phone (HIG, talk 111466).
  2. One app on both displays. Same features and same state closed and open. Open may add one level of hierarchy, as Mail adds the message beside the list (HIG).
  3. System containers first. NavigationSplitView, TabView, NavigationStack, sheets, alerts, menus and toolbar buttons already adapt to the fold (hub, talk 111463).
  4. Nothing interactive in the fold. Scrolling content may cross it (talk 111466).
  5. Even columns whenever a fold crosses a grid, active or not (HIG, talk 111463).
  6. Small moves. Move only what must move. Don't swap in a different view tree when the window resizes; you lose scroll position, selection and typing (HIG).
  7. Arrangement placement. Navigation outside, content inside. Put an ArrangementView inside a NavigationStack or a tab. Never put a navigation container inside an arrangement, and never put an arrangement inside a List or ScrollView. Don't nest it with a NavigationSplitView either way; Apple's pages disagree on that case, so see Combining patterns (talk 111463, HIG, hub).
  8. No posture API exists. Lay out with size classes, the view's own size, arrangements and reserved regions. Use the hinge (onHingeChange) for effects only (talk 111464).
  9. No device checks. Never lay out from UIScreen.main, userInterfaceIdiom, interface orientation or fixed sizes (prepare page).

What a layout can read

InputAPIUse it for
Width class@Environment(\.horizontalSizeClass)One pane or two
The view's own size and shapeonGeometryChange(for:of:action:)Wide or tall, column count
The foldreservedRegions(kind: .division, options:) (iOS 27.1)Where to split, where controls may not go
Cameras and the status bar cornerreservedRegions(kind: .occlusion, options:)Keeping controls clear
System margins, per sidecontentMargins(for: .container, edges:) (iOS 27.1)Asymmetric margins next to a vertical bar
Is a tab sidebar availableisTabViewSidebarAvailable (iOS 27.0)Hiding shortcuts the sidebar repeats

Pick a pattern

Answer in order. The first yes is the screen's main pattern. If a later question is also a yes, read Combining patterns.

  1. Many top-level sections, information-dense? Tabs to sidebar, then pick a pattern for each tab.
  2. Two halves that must both show in every pose (two players, a before and after), or two people sharing the screen? None of these patterns: use EvenSplit or FoldSplitLayout from duo-layout, and duo-shared-screen. A split arrangement can drop to its primary view alone, for example on the closed phone held sideways.
  3. Items, each with its own detail that makes sense alone? List-detail.
  4. A second view that only m
Read the complete source ↗