Prepare Your SwiftUI App For iPhone Duo

Open a draft. Type a sentence. Open the phone. Keep typing. Partially fold it, bring another app alongside it, then close it again.

Does the sentence survive? Is the same document still selected? Can you still find Save?

That is the iPhone Duo demo I want to see from an app. A larger screenshot is easy to appreciate, but a layout that changes without interrupting someone’s work is much more useful.

Apple announced iPhone Duo on September 9, with a 5.4-inch outer display and a 7.6-inch inner display. Preorders start October 16, and initial availability starts October 23. This is an announcement-week development guide, not a hands-on device review.

September 27 update: Apple’s Duo developer hub now links to Xcode 27.1 beta, preparation documentation, and developer group labs. The SDK was not available when the announcement-week draft was prepared. The baseline SwiftUI example below uses existing APIs and was compiler-checked; the iOS 27.1 features discussed later still need verification with that beta SDK. The code in this post uses APIs available in the installed iOS 27.0 SDK. Device availability remains October 23.

What Apple’s guidelines change

The new Duo Human Interface Guidelines emphasize consistent functionality, state, and hierarchy as the device changes shape. Standard containers handle much of the adaptation. Avoid turning each pose into a separate version of your app.

Here are the changes I would put in a review ticket:

AreaWhat to account for
NavigationThe wider display can expose more hierarchy while keeping the current task recognizable.
System barsControls move to a vertical edge in several configurations; the inner display in portrait retains horizontal bars.
Available spaceThe camera, system UI, and partially folded display affect where content belongs.
ContinuityClosing the device should preserve access to the same work and commands.

Apple’s preparation talk also distinguishes SDK behavior: existing apps run, iOS 27 extends content farther on the inner display, and building with iOS 27.1 enables the fullest adaptation, including vertical standard bars. Its layout guidance calls out asymmetric safe areas, scene-relative screen information, and the inner display’s disregard for supported interface orientations.

That last point makes an orientation switch a poor foundation for your screen.

Our earlier size-class article explains why .regular is not an exact width measurement. Apple’s advice to use size classes is compatible with that: use traits for broad presentation behavior, and measure a component when its content has a specific space requirement. Neither approach needs a device-model check.

Start with one editing session

For a concrete example, imagine reviewing a draft beside a short checklist. On a smaller presentation, the checklist sits below the editor. With more room, it sits alongside it.

The risky implementation creates a separate editor in each layout branch:

import SwiftUI

struct BranchingEditor: View {
    let showsChecklistBesideEditor: Bool

    var body: some View {
        if showsChecklistBesideEditor {
            HStack {
                LocalDraftEditor()
                Text("Review checklist")
            }
        } else {
            VStack {
                LocalDraftEditor()
                Text("Review checklist")
            }
        }
    }
}

private struct LocalDraftEditor: View {
    @State private var text = "Unsaved draft"
    var body: some View { TextEditor(text: $text) }
}

Because LocalDraftEditor owns its unsaved text, a change of structural identity can destroy the state you wanted to keep. A fetch or editor setup in an appearance callback can also run again. The layout looks reasonable while the editing experience falls apart.

Give the session an owner that outlives the layout choice. This small model deliberately keeps the draft and review progress together:

import Observation
import SwiftUI

@MainActor
@Observable
final class DraftReviewSession {
    var text = "A draft worth keeping."
    var checkedFacts = false
    var checkedLinks = false
}

This is an in-memory editing session. It is not persistence or restoration after process termination. A real document app should connect it to its existing document store and save policy; changing a display is not a substitute for saving a draft.

For the existing-API baseline, use AnyLayout to change the arrangement without duplicating the editor subtree. Apple’s AnyLayout documentation describes this preservation of subview state when changing layout container types.

@MainActor
struct DraftReviewScreen: View {
    @State private var session = DraftReviewSession()
    @Environment(\.horizontalSizeClass) private var widthClass
    @Environment(\.dynamicTypeSize) private var typeSize
    @FocusState private var editorFocused: Bool

    var body: some View {
        @Bindable var review = session

        let usesColumns =
            widthClass == .regular
            && !typeSize.isAccessibilitySize
        let layout =
            usesColumns
            ? AnyLayout(HStackLayout(alignment: .top, spacing: 20))
            : AnyLayout(VStackLayout(alignment: .leading, spacing: 20))

        NavigationStack {
            layout {
                TextEditor(text: $review.text)
                    .focused($editorFocused)
                    .accessibilityLabel("Draft")
                    .frame(maxWidth: .infinity, maxHeight: .infinity)

                VStack(alignment: .leading, spacing: 16) {
                    Text("Review")
                        .font(.headline)
                    Toggle("Facts checked", isOn: $review.checkedFacts)
                    Toggle("Links checked", isOn: $review.checkedLinks)
                }
                .frame(maxWidth: usesColumns ? 260 : .infinity)
            }
            .padding()
            .background {
                Color.indigo.opacity(0.06)
                    .ignoresSafeArea()
            }
            .navigationTitle("Review draft")
            .toolbar {
                ToolbarItem(placement: .primaryAction) {
                    Button("Edit", systemImage: "pencil") {
                        editorFocused = true
                    }
                }
            }
        }
    }
}

Here .regular selects a broad composition, while the 260-point maximum expresses this particular checklist’s preferred width. It is not a Duo screen dimension. The editor takes the remaining room. Accessibility text sizes switch to a vertical arrangement so the checklist has more width for wrapping.

The important part is ownership: one session, one editor declaration, and one focus binding. The layout decision never reloads the document or clears review progress. This does not guarantee that the system keeps the keyboard visible through every display transition. Focus, insertion position, and keyboard behavior still belong in the device test.

If your editor has a long inspector, make the inspector scroll independently and keep a route to it when space is constrained. Do not force a full settings form underneath a keyboard merely because a stack can contain it.

Let foreground and background use different bounds

The example applies ignoresSafeArea() to the background color. The editor and toggles remain inside the proposed safe content region.

That distinction matters on a device where one side can contain more system UI than the other. It is tempting to make a custom editor look centered by adding equal padding to both edges. Equal padding cannot correct unequal obstructions.

In a UIKit-backed editor, derive usable bounds from all four insets:

import UIKit

@MainActor
func usableBounds(of view: UIView) -> CGRect {
    view.bounds.inset(by: view.safeAreaInsets)
}

Do not subtract twice the left inset and assume that describes the right edge too. Likewise, when rendering a thumbnail for a view, its traitCollection.displayScale is more relevant than a cached main-screen scale. These are both changes highlighted in Apple’s preparation talk.

The design talk makes room for immersive, non-scrolling visuals that center on the full display. That is a content decision. A photograph may benefit from that treatment; a text insertion point hidden underneath controls will not.

Add fold awareness where it earns its complexity

The baseline above preserves state across layout changes. AnyLayout does not itself provide Duo hinge avoidance.

Apple’s adaptive-layout talk introduces iOS 27.1 ArrangementView for two related content areas. It supports split and overlay arrangements, driven by available geometry and reserved regions. Keep navigation around the arrangement, and avoid nesting the arrangement inside a scrolling container.

For the beta integration, start with Apple’s example in that talk and check its current declarations in Xcode 27.1. The installed 27.0 SDK cannot compile ArrangementView, so the tested code here stops at the existing-API baseline. Keep the editor as the primary content and the checklist as secondary content when evaluating a split arrangement.

I would try this when the existing product already has an editor-and-inspector relationship. Keep the editing model above the workspace, then check whether the arrangement preserves convenient access to both areas. A successful layout should make review easier, not just fill two halves of a display.

The same talk exposes reservedRegions(kind:) through GeometryProxy. A .division region describes the fold; an .occlusion region describes an obstruction such as the inner camera. Queries return active regions by default, with .includeInactive available for other decisions. Use those regions for a custom canvas or control that needs precise placement.

For a reading surface, I would leave the continuous text flow intact and inspect individual floating controls first. Moving a floating annotation button is a much smaller disruption than rearranging an entire article while someone reads it.

Keep the commands recognizable

Our resizable-toolbar post already covers priorities and overflow. The Duo-specific addition is that a custom control may need to adapt to a vertical bar.

Apple’s bar adaptation talk shows axisBehavior(_:) for custom toolbar content and toolbarVerticalEdge for observing the edge. Standard containers provide the system-managed bars; manually assembling a horizontal strip of buttons does not provide the same behavior.

For the draft reviewer, I would keep a title and symbol on each action, make reviewing commands available even if they move into overflow, and check that a wide custom status control does not squeeze out the editing action. A tiny icon that remains visible is only useful if people can identify it.

With the Xcode 27.1 beta and its supported Device Hub configurations, run a repeatable interaction through the simulated poses. Apple’s preparation talk previews controls for opening, closing, rotating, and folding. Follow with physical-device testing when hardware is available.

This is the regression script I would attach to the feature:

StepActionWhat must survive
1Open a known draft and type a unique sentence.Document identity and exact draft text.
2Check one review item, then open the device.The checked item and insertion context.
3Partially fold it with the editor active.Readable text and reachable editing controls.
4Put another app beside it, then change the available width.The current draft and access to the checklist.
5Present a sheet and change the pose.Sheet contents and the pending action.
6Close and reopen the device.Unsaved changes and the same destination.

Repeat with large accessibility text, a right-to-left language, and a long document. Also try the outer display with the keyboard visible: a comfortable screen without a keyboard can become a poor editor once someone starts typing.

For an instrumented build, record document-load counts and editor-session creation counts through this sequence. Unexpected increases give you a useful lead on view identity or lifecycle work. Keep the probe tied to session behavior; there is no need to record the user’s draft text.

The camera deserves its own version of this exercise. If your app captures video, read Switch Cameras Across iPhone Duo Displays for the difference between following the viewer and preserving a recording configuration.

The most interesting Duo feature for an editor may be the one someone barely notices: they open the phone, get more room to work, and continue the same sentence.