JUST ENDED
|

iPhone Duo SwiftUI Q&A

Visit the Apple Developer Forums to discuss building SwiftUI layouts that adapt to iPhone Duo. Learn about size classes across both displays, asymmetric safe areas, reserved regions and arrangements, navigation and tab views, and responding to the hinge angle.

Post

Replies

Boosts

Views

Activity

Can a non-camera game present supplementary content on iPhone Duo’s outer display?
I’m building a real-time game where the primary gameplay runs on the inner display. I’d like to use the outer display for optional supplementary content such as a scanner, companion view, enemy sensor, or other game information. The current Scene Accessories examples appear centered around CameraCaptureAccessory. Is there a supported API for a non-camera app or game to present arbitrary supplementary content on the outer display while the main game remains active on the inner display? If not currently supported, should developers design the outer-display feature as optional and wait for additional accessory types?
Topic: UI Frameworks SubTopic: SwiftUI
0
0
4
9h
Using the Second Display for Approval Flows
For a guided SwiftUI flow with a blocking approval step, how would you recommend using the second display on iPhone Duo? For example, while the user waits for approval on one display, would showing the submitted information or other contextual content on the other display be an appropriate pattern?
Topic: UI Frameworks SubTopic: SwiftUI
1
0
52
9h
Is devicectl appResize the intended mechanism for testing foldable scene sizes?
As a workaround we used xcrun devicectl device appResize. It works: setting 951×669 makes our layout classifier report wideSplit and 669×951 reports tallSplit, confirmed from the app's own debug readouts. Two behaviours we had to discover empirically: the resize must be applied while xcodebuild test is already running, because xcodebuild's own app launch resets a size set beforehand; and appResize start needs roughly six seconds to establish the session, failing at two seconds with "not currently hosting a resizable app session". Is appResize the intended mechanism for exercising foldable scene sizes in tests, or is there a first-class API we should be using instead?
Topic: UI Frameworks SubTopic: SwiftUI
0
0
7
9h
Custom Layout protocol and Layout.Cache invalidation during continuous hinge transitions across reserved regions
Hello SwiftUI team, When building custom container layouts conforming to the Layout protocol that dynamically flow content around the new .division reserved region (avoiding the fold area), what is the expected performance contract during rapid physical hinge movement? Does the continuous hinge motion invalidate the layout cache (makeCache / updateCache) on every frame, or are intermediate hinge angles decoupled from container re-measurements (sizeThatFits) to prevent layout thrashing? For asymmetric safe areas across the inner dual-pane presentation, what is the canonical way for a custom Layout to read the reserved division bounds directly from LayoutSubviews / subview.layoutPriority, without having to wrap each subview in a GeometryReader or an explicit ArrangementView that could disrupt matchedGeometryEffect transitions across the fold? Thanks!
Topic: UI Frameworks SubTopic: SwiftUI
0
1
8
9h
Outer and inner displays transition
When the app moves between the outer and inner displays, does SwiftUI preserve view identity end to end: @State, scroll position, @FocusState, an active text field with the keyboard up, presented sheets and popovers? Is anything recreated, and does scenePhase change during the transition?
Topic: UI Frameworks SubTopic: SwiftUI
1
0
98
9h
Alignment issues on right reserved area
See screenshot (closed state) for an example of the kinds of issues we are seeing with certain shapes. I'm sure we can figure out something with the safe area view modifiers; my question is more conceptual about why this sort of thing would happen in the first place and if you have any best practices to avoid it.
Topic: UI Frameworks SubTopic: SwiftUI
0
0
17
9h
Top alignment
What’s the recommended approach for aligning a component at the top? On other devices, we’ve "relied" on the top safe area as spacing. However, on the Duo, when folded or opened in landscape mode, the top safe area is zero. What’s the recommended way to handle the top spacing in this case? Should we detect when the top safe area is zero and add a custom top padding instead?
Topic: UI Frameworks SubTopic: SwiftUI
0
1
37
10h
Is `ArrangementView` intended only for iPhone Duo?
Is ArrangementView intended specifically for iPhone Duo, or should it also be used for adaptive layouts across iPhone and iPad? This is unclear because when I use a horizontally or vertically split ArrangementView on a non-Duo device, such as iPad, it only displays one of its child views. If ArrangementView is Duo-specific, what is the recommended way to use it only on iPhone Duo while falling back to a different layout on other devices? I haven’t seen an API or pattern for conditionally switching between those layouts.
Topic: UI Frameworks SubTopic: SwiftUI
0
4
82
10h
Can a non-camera game present supplementary content on iPhone Duo’s outer display?
I’m building a real-time game where the primary gameplay runs on the inner display. I’d like to use the outer display for optional supplementary content such as a scanner, companion view, enemy sensor, or other game information. The current Scene Accessories examples appear centered around CameraCaptureAccessory. Is there a supported API for a non-camera app or game to present arbitrary supplementary content on the outer display while the main game remains active on the inner display? If not currently supported, should developers design the outer-display feature as optional and wait for additional accessory types?
Topic: UI Frameworks SubTopic: SwiftUI
Replies
0
Boosts
0
Views
4
Activity
9h
Using the Second Display for Approval Flows
For a guided SwiftUI flow with a blocking approval step, how would you recommend using the second display on iPhone Duo? For example, while the user waits for approval on one display, would showing the submitted information or other contextual content on the other display be an appropriate pattern?
Topic: UI Frameworks SubTopic: SwiftUI
Replies
1
Boosts
0
Views
52
Activity
9h
XCUIDevice.shared.orientation appears to be a no-op on iPhone Duo (iOS 27.1)
Setting XCUIDevice.shared.orientation has no effect on the Duo simulator running iOS 27.1 — the window size and our computed layout mode stay unchanged. We measured this on two clean boots. On other devices (iPhone 18 Pro, iOS 27.0) the same call works as expected. Is orientation expected to be a no-op on Duo, or are we holding it wrong?
Topic: UI Frameworks SubTopic: SwiftUI
Replies
0
Boosts
0
Views
8
Activity
9h
Is devicectl appResize the intended mechanism for testing foldable scene sizes?
As a workaround we used xcrun devicectl device appResize. It works: setting 951×669 makes our layout classifier report wideSplit and 669×951 reports tallSplit, confirmed from the app's own debug readouts. Two behaviours we had to discover empirically: the resize must be applied while xcodebuild test is already running, because xcodebuild's own app launch resets a size set beforehand; and appResize start needs roughly six seconds to establish the session, failing at two seconds with "not currently hosting a resizable app session". Is appResize the intended mechanism for exercising foldable scene sizes in tests, or is there a first-class API we should be using instead?
Topic: UI Frameworks SubTopic: SwiftUI
Replies
0
Boosts
0
Views
7
Activity
9h
Custom Layout protocol and Layout.Cache invalidation during continuous hinge transitions across reserved regions
Hello SwiftUI team, When building custom container layouts conforming to the Layout protocol that dynamically flow content around the new .division reserved region (avoiding the fold area), what is the expected performance contract during rapid physical hinge movement? Does the continuous hinge motion invalidate the layout cache (makeCache / updateCache) on every frame, or are intermediate hinge angles decoupled from container re-measurements (sizeThatFits) to prevent layout thrashing? For asymmetric safe areas across the inner dual-pane presentation, what is the canonical way for a custom Layout to read the reserved division bounds directly from LayoutSubviews / subview.layoutPriority, without having to wrap each subview in a GeometryReader or an explicit ArrangementView that could disrupt matchedGeometryEffect transitions across the fold? Thanks!
Topic: UI Frameworks SubTopic: SwiftUI
Replies
0
Boosts
1
Views
8
Activity
9h
Outer and inner displays transition
When the app moves between the outer and inner displays, does SwiftUI preserve view identity end to end: @State, scroll position, @FocusState, an active text field with the keyboard up, presented sheets and popovers? Is anything recreated, and does scenePhase change during the transition?
Topic: UI Frameworks SubTopic: SwiftUI
Replies
1
Boosts
0
Views
98
Activity
9h
Alignment issues on right reserved area
See screenshot (closed state) for an example of the kinds of issues we are seeing with certain shapes. I'm sure we can figure out something with the safe area view modifiers; my question is more conceptual about why this sort of thing would happen in the first place and if you have any best practices to avoid it.
Topic: UI Frameworks SubTopic: SwiftUI
Replies
0
Boosts
0
Views
17
Activity
9h
Top alignment
What’s the recommended approach for aligning a component at the top? On other devices, we’ve "relied" on the top safe area as spacing. However, on the Duo, when folded or opened in landscape mode, the top safe area is zero. What’s the recommended way to handle the top spacing in this case? Should we detect when the top safe area is zero and add a custom top padding instead?
Topic: UI Frameworks SubTopic: SwiftUI
Replies
0
Boosts
1
Views
37
Activity
10h
Is `ArrangementView` intended only for iPhone Duo?
Is ArrangementView intended specifically for iPhone Duo, or should it also be used for adaptive layouts across iPhone and iPad? This is unclear because when I use a horizontally or vertically split ArrangementView on a non-Duo device, such as iPad, it only displays one of its child views. If ArrangementView is Duo-specific, what is the recommended way to use it only on iPhone Duo while falling back to a different layout on other devices? I haven’t seen an API or pattern for conditionally switching between those layouts.
Topic: UI Frameworks SubTopic: SwiftUI
Replies
0
Boosts
4
Views
82
Activity
10h