duo-postures
Designs iPhone Duo screens for every pose Apple shows: closed on the outer display, open flat (wide or tall), partly folded like a book, propped on a table like a laptop (tabletop), standing like a tent, and open and turned around (flipped, rear cameras facing the user). Use it when a screen must work half folded, when you build a tabletop media player or video call (video on top, the same controls below the fold), a book-pose layout with two regions, or a hinge effect. There is no posture API: read size classes and the .division reserved region (active only when partly folded) with FoldGeometry and FoldRegionsLayout, and keep onHingeChange and UIHingeInteraction for effects, with Reduce Motion and accessibility rules.
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-posturesAbout this skill
name: duo-postures description: "Designs iPhone Duo screens for every pose Apple shows: closed on the outer display, open flat (wide or tall), partly folded like a book, propped on a table like a laptop (tabletop), standing like a tent, and open and turned around (flipped, rear cameras facing the user). Use it when a screen must work half folded, when you build a tabletop media player or video call (video on top, the same controls below the fold), a book-pose layout with two regions, or a hinge effect. There is no posture API: read size classes and the .division reserved region (active only when partly folded) with FoldGeometry and FoldRegionsLayout, and keep onHingeChange and UIHingeInteraction for effects, with Reduce Motion and accessibility rules." metadata: verified: "Xcode 27.1 (27A9275), iOS 27.1 simulator, device: no" sources: "https://github.com/Kimeur/duology/blob/main/reference/sources.md"
Duo postures
Use this skill to decide what a screen does in each way people hold or set down iPhone Duo, then build it. It covers closed, open flat, book, tabletop, tent and flipped, the two layouts Apple singles out (half folded like a book, and set on a table), and the hinge as a source of effects.
Load neighbours when the task needs them: duo-layout (size classes, safe areas, reserved regions in depth), duo-patterns (which layout pattern a screen uses), duo-navigation (bars and sheets), duo-continuity (state through a fold).
Words
Apple calls these "device poses" and describes them with comparisons: "partially folded, like a book", "seated on a table like a laptop", "folded like a tent", "open, turned around". It never says "posture", "tabletop" or "tent mode". Duology uses book, tabletop, tent and flipped as shorthand for those descriptions. None of them is an API, an enum case or a Device Hub button. Never write code that pretends the system reports them. Labels below: measured means we ran it on the iPhone Duo simulator; unverified means we could not confirm it.
Rules
- Design two layouts, not six. Build one for compact width (the outer display) and one for regular width (the inner display). Together they cover every pose. Let the layout grow; don't design one per pose (HIG, talk 111466).
- There is no posture API. Read the size class, the view's own size and the
.divisionreserved region. Active division means partly folded. Its shape tells you which way the fold runs (talk 111463, api-index). - Same controls and hierarchy in every pose. Tabletop is the one optional special layout Apple suggests, and it keeps every control (talk 111466).
- Nothing interactive in the fold when it is active. Scrolling content may cross it (talk 111466).
- Small moves. Move only what must move, keep groups together, and keep each view's identity so state survives (HIG).
- The hinge is for effects. Never lay out from the hinge angle or status. Hinge input is a novelty: opt-in, with an on-screen alternative, and off with Reduce Motion (talk 111464).
- Check every pose in Device Hub before you call a screen done.
Tell the poses apart from layout inputs
Add FoldGeometry and FoldRegionsLayout from references/fold-regions.md once per app. If the app already has a FoldGeometry (duo-patterns adds one), keep a single copy, and make sure its init(_:) filters with liesInside(_:of:) as fold-regions.md shows. A copy taken from duo-patterns before v0.2 may lack the filter; add it. Then read the fold with .onFoldChange { fold = $0 } on the view you lay out.
| Pose (Duology word) | Apple's words | Your app is on | Size classes (width, height) | .division region | FoldGeometry |
|---|---|---|---|---|---|
| Closed | closed | Outer display | compact, regular in portrait; compact, compact in landscape (111461) | none | frame == nil |
| Tent | "folded like a tent", "standing on its edges" | Outer display, held sideways (our reading of Apple's drawing and talk 111461; unverified) | compact, compact | none | frame == nil |
| Open, flat | "open in a wide layout", "open in a tall layout" | Inner display | regular, regular (measured held wide) | inactive | frame != nil && !isActive |
| Book | "partially folded, like a book" | Inner display, held wide | regular width expected (unverified) | active, top to bottom | isActive && isVertical |
| Tabletop | "seated on a table like a laptop" | Inner display, held tall | regular width expected (unverified) | active, side to side | isActive && !isVertical |
| Flipped | "open, turned around" | Outer display, phone still open (camera apps) | compact width (derived; unverified) | none | frame == nil |
What this means for code:
- A view sees its size, its size class and its regions. That is all a layout needs. "Book" is just "an active fold runs top to bottom through this view".
- Tent looks like the closed phone held sideways, and flipped looks like the closed phone. Don't try to tell them apart.
- Hinge status says how open the phone is, not which display you are on. When flipped, the phone is open but your app is on the outer display. Never pick a layout from
DeviceHinge.Status.