/iphone-duo-skills:iphone-duo-displaysfrom iphone-duo-skills
Provides guidance on iPhone Duo hinge APIs, dual displays, multiple windows, and camera direction in SwiftUI and UIKit. Covers onHingeChange, UIHingeInteraction, scene activation, CameraCaptureAccessory, and preview mirroring.
Ships in iphone-duo-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Code: references/displays-code.md. Availability: references/api-availability.md —
the hinge APIs, CameraCaptureAccessory, the direction coordinator and the physical
front camera types need the iOS 27.1 SDK, which ships with Xcode 27.1;
sceneAccessory, onAvailabilityChange, UISceneAccessory and
UIWindowScene.ActivationAction exist earlier. The hinge reaches you only through
UIHingeInteraction / onHingeChange: there is no trait, no notification and no
UIDevice property. StandBy cannot be verified in the iPhone Duo simulator
(Xcode 27.1 known issues 187708663, 187708767). Which half
carries the outer display and the inner camera, how each pose faces, and what each
camera can do: references/device-geometry.md.
onHingeChange { previous, context in … }; UIKit
UIHingeInteraction { _, update in … } added to a view with addInteraction.unknown) — and
a continuous angle (UIHinge.angle is in radians; the SwiftUI sample uses Angle).context.hinge == nil (UIKit: update.hinge == nil) means the device has no hinge
or the view left a hierarchy that provides hinge updates: every hinge feature must
degrade to nothing on other devices.initWithUpdateHandler:). On that
first call oldContext.hinge is nil (Booted, outer display: nil → closed at
0°), so set up from the new context instead of waiting for a change.onHingeChange(isEnabled:) / UIHingeInteraction.isEnabled. Updates
while disabled are dropped, not queued; re-enabling delivers the current state
(UIKit header, isEnabled).status when the posture is all you need. The rate and granularity of
angle updates are system policy and change with system state (UIKit header,
UIHinge.angle), and the status is the system's own reading of the angle and
the device orientation (DeviceHinge documentation) — don't re-derive it from
angle thresholds. DeviceHinge.Status is a struct with static members, not an
enum, so a switch over it needs default (SDK). The simulator shows why
(Booted, references/device-geometry.md): it reported partially open at
174°, fully open only at 180°, and closed already at 19°..partiallyOpen when reading the angle, and reset in the else branch
so the effect does not stick when the device opens flat or closes.iphone-duo-layout).iphone-duo-layout).references/pose-test-matrix.md.UserDefaults and @AppStorage are not per window.
Audio and video playback belongs to the instance that started playback most
recently (Forums 847644).DUO010 flags errorHandler: nil).UIWindowSceneActivationAction (Swift: UIWindowScene.ActivationAction) for
"Open in New Window" controls: it hides itself when new windows are not available.UIApplicationSupportsMultipleScenes must not rely on global
window state (iphone-duo-adaptivity-audit, rule DUO009).false to avoid coordinating state across
windows now leaves Split View pairs and "open in new window" on the table. Treat it
as a Tier 3 item: enable it only if the app tolerates several windows, test two
windows on an iPad first, then on iPhone Duo. The scanner reports the key's value
under project.supports_multiple_scenes..sceneAccessory { CameraCaptureAccessory(isEnabled: $model.isEnabled) { … } .onAvailabilityChange { model.isAvailable = $0 } } and a toolbar toggle disabled when
unavailable (for example when the device is closed).UISceneAccessory.cameraCapture(sceneConfiguration:userInfo:) passed to
registerSceneAccessory(_:) on the capture view controller; keep the returned
UISceneAccessoryRegistration (isAvailable is observable — read it in
updateProperties(); set isEnabled from the toggle) and call
unregisterSceneAccessory(_:) when the app stops offering the content. The
accessory scene's session role is windowCameraCaptureAccessory; the shared model
arrives as connectionOptions.sceneAccessoryUserInfo. No scene-manifest entry is
needed or honored. (Apple documentation › Registering a camera capture accessory)TimelineView or
CADisplayLink (Forums 847644). An app cannot show an accessory without the
conditions the system requires, only toggle its own content with isEnabled.An accessory is only available with an active camera session, so check the session
really runs: a camera usage description (NSCameraUsageDescription), an authorization
request, inputs added without swallowed errors, and outputs for what the app records.
Missing prerequisites come first in the plan — otherwise the accessory silently never
appears and looks like an iPhone Duo bug. Recording itself must never wait on the
accessory being available.
iPhone Duo has two front cameras, both square ultrawide sensors: the outer camera and the under-display inner camera. Which way a camera faces depends on the display the app is on, and opening or closing the device moves the app to the other display.
DiscoverySession with position
.front and the wide or ultra wide type returns the Virtual Front Camera, one
AVCaptureDevice that streams from the inner camera when open and the outer camera
when closed (isVirtualDevice == true; activePrimaryConstituent names the
streaming camera). It offers only what both cameras share — 1080p, 60 fps, no
depth. (1:01, 2:28)builtInOuterUltraWideCamera
(up to 4K at 120 fps) and builtInInnerUltraWideCamera (1080p up to 60 fps) expose
each camera fully, and switching on open/close becomes the app's job. (1:53)position is where a camera sits, not where it points. Both front cameras
report .front; a front camera can face away from the person looking at the app,
and the rear cameras face the person when the open device is turned around.
Create an AVCaptureDeviceDirectionCoordinator(view:deviceTypes:) on the preview
view, listing every built-in camera the app captures from — rear types included,
the two physical front types instead of the virtual one — and keep it alive while
the view is on screen. Its handler reports an AVCaptureDeviceDirectionMap; pick
from forwardFacingDeviceDescriptors when the active camera is no longer in it.
(2:53–4:49)AVCaptureDeviceDescriptor (Sendable) to the actor that owns the session, which
resolves it with AVCaptureDevice(uniqueID:), handles a nil result, and swaps
the single video input inside beginConfiguration / commitConfiguration. Two
displays showing a preview (a capture accessory) mean two coordinators, one per
view. (5:37–6:16)automaticallyAdjustsVideoMirroring = false before assigning isVideoMirrored
(assigning while it adjusts raises), only when position and direction disagree, and
reapply after reconnecting an input. Mask the preview while the new camera starts.AVCaptureDevice.RotationCoordinator; it updates when the app
moves displays, and it is created per device, so make a new one on every camera
switch. Then disable camera-sensor-orientation compensation, which is on for every
front camera on iPhone Duo, to save work. (8:08)videoGravity. dynamicAspectRatio lets the square front sensors deliver
a landscape frame on the inner display. (7:03)StandBy runs on either display "even when it's not charging": a folded or tented
iPhone Duo on a desk is a screen facing the room, filled with widgets and Live
Activities. An app with neither is absent from it. For apps that have a natural
glanceable state (next event, timer, score, order status), a widget or Live Activity
is a Tier 3 item; the scan inventory reports WidgetKit and Live Activities
adoption. The Dynamic Island on the side stack expands vertically for Live Activities
(HIG › Reserved regions), so nothing extra is needed there — but every presentation
of the ActivityConfiguration must exist: compact leading and trailing, minimal,
expanded, and the Lock Screen (Forums 847644). Alarm and timer apps adopt AlarmKit
and let it present the alert (Forums 847644).
AVCaptureSession → camera accessory candidate, and
with front camera discovery or video mirroring → camera direction review;
multiple scene requests or UIApplicationSupportsMultipleScenes → scene
handling review; custom gesture or sensor-driven features → hinge candidates;
no WidgetKit / Live Activities → StandBy presence item.references/recommendation-format.md; mark 27.1 APIs blocked when
the SDK lacks them; apply after approval; build.references/pose-test-matrix.md.
For hinge-driven effects, scripts/duo_pose.py set <degrees> (or hinge -d <udid> sweep) moves the simulator's hinge while the app runs — third-party hinge CLI;
ask first. Expect repeated calls with equal contexts and a smoothed angle.position; ask a direction
coordinator, and write one code path that also runs on single-display iPhones
(there the coordinator reports once and never changes).evals/evals.json (opens in a new tab)evals/files/ClipRecorder/ClipRecorder/RecorderScreen.swift (opens in a new tab)evals/files/FoldZoom/FoldZoom/FoldAnalytics.swift (opens in a new tab)evals/files/FoldZoom/FoldZoom/ZoomControl.swift (opens in a new tab)evals/files/HingeBadge/HingeBadge/HingeBadge.swift (opens in a new tab)evals/trigger-evals.json (opens in a new tab)references/api-availability.md (opens in a new tab)references/device-geometry.md (opens in a new tab)references/displays-code.md (opens in a new tab)references/pose-test-matrix.md (opens in a new tab)references/recommendation-format.md (opens in a new tab)references/sources.md (opens in a new tab)scripts/duo_pose.py (opens in a new tab)scripts/duo_scan.py (opens in a new tab)scripts/sdk_api_check.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
npx claudepluginhub alexey1312/iphone-duo-agent-skill --plugin iphone-duo-skills5 skills in this plugin
/iphone-duo-adaptivity-auditFind and fix legacy screen, orientation, idiom and lifecycle code that breaks on iPhone Duo's inner display and in other iOS 27 resizable environments (iPhone Mirroring, iPhone apps on iPad, Split View). Use when a developer asks about UIScreen.main or mainScreen, screen bounds or scale, interfaceOrientation or UIDevice orientation checks, userInterfaceIdiom layout forks, keyWindow or connectedScenes.first, migrating from app lifecycle to UIScene lifecycle (required with the latest SDK), UIRequiresFullScreen, a missing launch screen (ITMS-90870), portrait-only apps, or hard-coded Face ID strings and symbols (iPhone Duo has Touch ID; branch on LAContext.biometryType). Covers SwiftUI and UIKit, ships a read-only scanner, and delegates bulk UIKit rewrites to Xcode's own modernization skill when available. Not for app features that merely touch UIScreen or orientation, such as screen brightness, deliberately locking a game to one orientation, or camera and sensor setup./iphone-duo-barsPrepare navigation bars, toolbars and tab bars for iPhone Duo's vertical bars, where controls move to the side of the outer display and of the inner display in landscape. Use when a developer asks about vertical bars, bar item ordering, back, custom back or close button placement, pinned trailing or prominent actions, toolbar items without titles, axisBehavior, symbol-only items and badges, custom views in toolbars, toolbarVerticalEdge or verticalBarEdge, overflow menus and ToolbarOverflowMenu, visibilityPriority, toolbar or tab bar compression, custom UIToolbar or UINavigationBar instances, hand-built tab bars or bars that must stay custom, sheet toolbars and presentationPlacement, backgrounds under the bar with backgroundExtensionEffect, or opting out with toolbarVerticalBehavior. Covers SwiftUI and UIKit, based on Apple's "Raise the bar with iPhone Duo", "Preparing your app for iPhone Duo" and Apple engineers' forum answers./iphone-duo-layoutUse when an app's layout or geometry breaks or wastes space on iPhone Duo's foldable inner display: layouts that should become multi-column in regular × regular size classes, NavigationSplitView or TabView sidebars, a phone-width column stuck in the middle, asymmetric safe-area insets, content under the side bar or the keyboard in Split View, content, floating controls, sheets, collection-view sections or WKWebView pages crossed by the hinge in book or tabletop pose, the FaceTime camera covering UI, or video letterboxing on the wide inner screen. Also use it for the iOS 27.1 layout APIs: reservedRegions (division, occlusion, right-to-left mirroring), ReservedRegion / UIView.ReservedRegion, ArrangementView / UIArrangementViewController split or overlay with their ratio, edge and axis modifiers, and corner-aware margins. Not for toolbar items or overflow menus, removing idiom or orientation checks, hinge-angle interactions, or generic SwiftUI and Auto Layout bugs unrelated to the foldable./iphone-duo-readinessEnd-to-end readiness workflow for iPhone Duo, Apple's foldable iPhone with an outer display and a regular-by-regular inner display. Use when a developer wants to prepare, audit, plan or test a SwiftUI or UIKit iOS app for iPhone Duo, the iOS 27 / 27.1 SDK resizable-app changes, foldable poses and the hinge, vertical bars, Device Hub pose simulation, Apple's "Prepare your app for iPhone Duo" guidance, or what an iPhone Duo submission owes App Store Connect (screenshots for both displays, the April 2027 deadlines). Runs a read-only scan and SDK check first, produces a tiered plan with session citations, changes code only after itemized approval by delegating to the iphone-duo specialist skills, and verifies against a pose matrix.