Provide views, controls, and layout structures for declaring your app's user interface using SwiftUI.

SwiftUI Documentation

Posts under SwiftUI subtopic

Post

Replies

Boosts

Views

Activity

Can a Notes note be dragged into another app on iPhone Duo?
I’m adding drag-and-drop support to my app for multitasking on iPhone Duo. My app supports text/note content. Currently, a user can move content from Apple Notes into my app using Share or Copy/Paste. ** Questions** Can a note from the Notes app be dragged directly into another app during multitasking, similar to dragging a photo? If so, what content type does Notes provide through the drag-and-drop session? For example, is the note exposed as plain text (public.plain-text / UTType.plainText), rich text, or another transferable type? My goal is for the user to drag a note from Notes into my app and have it behave essentially like Copy → Paste, without requiring the Share sheet. Thank you.
0
0
31
6h
SwiftUI Document API Duplicate Function hangs on macOS 27
In a macOS 27 app using DocumentGroup(editor:makeDocument:) with a type conforming to the new Document protocol, choosing File › Duplicate hangs the app permanently (0% CPU, spinning beach ball, must force quit). The main thread is blocked in URLPlatformDocument.read(from:ofType:) waiting on a dispatch semaphore. That synchronous NSDocument read path is reached from NSDocumentController.duplicateDocumentWithContentsOfURL(:copying:displayName:) → makeDocumentForURL(:withContentsOf:ofType:) → NSDocument.init(for:withContentsOf:ofType:). The work the semaphore waits for never runs: the app's makeDocument closure is never called. The SDK declares makeDocument and ReadableDocument.apply(snapshot:previous:) as @MainActor, so blocking the main thread while waiting for them can never complete. This reproduces with Apple's unmodified sample code project "Building a Document-Based App with SwiftUI" (no code or project changes; only a signing team set). Our own app, which uses a custom DocumentReader/DocumentWriter with Source/Destination == URL, hangs with the identical stack. Has anyone found any workaround? Filed Feedback FB24949862
Topic: UI Frameworks SubTopic: SwiftUI
0
0
27
7h
sidebarAdaptable Design Problem
This is what Apple's Destination Video Sample App looks like on iPhone Duo built with SDK 27.1 beta. Two things: Items that should not appear in the tab bar appear. There is no sidebar for iPhone Duo. So my problem is: is this a bug or a design on purpose? Will sidebarAdaptable gets a sidebar on iPhone Duo? Or at least, how to hide these things that should only appear in the sidebar? The sample app uses .defaultVisibility(, for:) and .hidden() but obviously none of these takes effect.
Topic: UI Frameworks SubTopic: SwiftUI
1
1
170
7h
Supported way to put an iPhone Duo simulator into the unfolded state programmatically
The Duo simulator boots showing only the outer display: the window is fixed at 382×644 pt and our layout classifier always reports the compact stack mode. We measured this on two separate clean boots (shutdown, erase, boot). xcrun simctl help lists no subcommand for folding, posture, or selecting the inner display — we read the full list. xcrun simctl io screenshot does reveal a second display (LCD-1, 2007×2853 px, aspect 0.70, close to the 669×951 inner portrait size). Unfolding manually in the Simulator UI works and the app then renders the two-column layout correctly, but we could not find a programmatic equivalent. Is there a supported way to unfold a Duo simulator from the command line or from XCTest?
Topic: UI Frameworks SubTopic: SwiftUI
3
3
702
1d
Enable iPhone Duo Upside Down Orientation
Ever since the iPhone X, upside-down orientation on the iPhone has been disabled by design. I haven't found any official documentation explaining why, but my guess is it has to do with Face ID and the top notch. However, now that the iPhone Duo has no Face ID or notch—and includes reserved occlusion regions—why not enable upside-down rotation? As of iOS 27.1, it remains disabled. Leaving it turned off only confuses users, making them think their favorite apps are frozen when they won't rotate.
Topic: UI Frameworks SubTopic: SwiftUI
1
1
308
1d
iPhone Duo and the Safe-Area
I took a screenshot of the Safety Area's and Occlusions on the iPhone Duo outer display. The article Designing for iPhone Duo tells us to... Consider using the full display width for interfaces where bars aren’t necessary. Some layouts can span the full display, which works well for visual, immersive interfaces that don’t scroll, as long as nothing conflicts with the Dynamic Island or the status bar. Calculator, for example, occupies the full width of the display. You can also combine both approaches, letting a background image or header span the full width while scrollable content stays inset. The Graphics Content can easily take up the full space which can be achieved by ignoring the safe area (.ignoresSafeArea()). And knowing the iPhone Duo there is no occlusion so I can also ignore the safe area for the interactable content. However we now are entering an awkward state. Because now I need to make decisions based on a specific device. Knowing the iPhone Duo I can ignore horizontal safe area and expand to full width because there is no occlusions here, but ignoring the safe-area may result in unexpected behavior on other (future) devices which then requires me to use code that specificly targets certain devices. I wished SwiftUI had something that I could safely expand the interactable content the full width.
Topic: UI Frameworks SubTopic: SwiftUI
2
0
105
1d
Charts are broken with Xcode 27, Plotting multiple lines
Hi, Charts—specifically those with multiple lines—are broken in Xcode 27. First, I spotted the bug in my program, and then I checked your example. Your own example Plotting-multiple-lines is not working correctly anymore. It shows 1 line or sometimes no lines at all, depending on the order of the data. It depends on how the data is passed to the chart. If the data is passed as separate series, it works. In Visualizing your app’s data it works, but the data is passed as described before. Don't follow Microslop: have the AI ​​generate the code and then skip the tests. This is a serious bug that requires a lot of work to rearrange the data, just to work around the issue. Christian
0
0
221
1d
App Intents and the Document App Xcode Template
I’m working on an app that deals with a list of text items, so I started with the document app template in Xcode. I have the app basically doing what I want it to do, but I want to be a good ecosystem citizen, so I’d like to conform to app intents. I think that app intents will able to do what I want - accepting text and passing it back out - but I can’t figure out how to access the document outside of my content view and associated subviews. Any guidance would be appreciated. Thank you, Don Carlile
1
0
404
2d
How to implement correct horizontal padding for iPhone Duo
The iPhone Duo outer screen displays a vertical bar on the right edge with view contents inset. A SwiftUI Form displays an appropriate amount of leading padding but 0 padding on the trailing edge, since the vertical bar provides some visual margins already that looks nice. I have a view that looks kind of like a form, multiple stacked text fields, that should align the same way. I used scenePadding to achieve which looks correct on iPhone 18 Pro perfectly aligned with Form, but on iPhone Duo there is extra trailing padding. It doesn't align with my Edit button that remains in the horizontal axis navigation bar (and it is not inset enough on the leading edge, off by a few pixels, interestingly). Note when you unfold it and add the app on the left side in Split View, the vertical bar is on the leading edge, in which case there's too much padding on the leading edge. How can I achieve the correct layout padding/margins? iPhone 18 Pro vs iPhone Duo: My actual app: struct ContentView: View { var body: some View { TabView { NavigationStack { SystemFormView() .navigationTitle("System Form") } .tabItem { Label("System Form", systemImage: "list.bullet.rectangle") } NavigationStack { CustomFormView() .navigationTitle("Custom Form") } .tabItem { Label("Custom Form", systemImage: "rectangle.3.group") } } } } private struct SystemFormView: View { var body: some View { Form { Text("Row 1") Text("Row 2") Text("Row 3") } } } private struct CustomFormView: View { var body: some View { ScrollView { VStack(spacing: 0) { customRow("Row 1") Divider() .padding(.leading) customRow("Row 2") Divider() .padding(.leading) customRow("Row 3") } .background(.background) .scenePadding(.horizontal) } .background(Color(uiColor: .systemGroupedBackground)) } private func customRow(_ title: LocalizedStringKey) -> some View { Text(title) .frame(maxWidth: .infinity, minHeight: 44, alignment: .leading) .padding(.horizontal) } } Note in UIKit, UITableViewController with the inset grouped style has the same layout as Form. A custom view hierarchy can achieve the exact same placement/padding/margins by following these steps: create a scroll view and a content view, set preservesSuperviewLayoutMargins = true on both views, constrain the scroll view to the root view on all edges, constrain the content view to the scrollView.contentLayoutGuide on all edges, constrain the content view width anchor to the scrollView.frameLayoutGuide.widthAnchor, then constrain subviews of the content view to the contentView.layoutMarginsGuide. So I know how to do it in UIKit, how do we in SwiftUI? Thanks!
Topic: UI Frameworks SubTopic: SwiftUI
3
1
169
2d
How to separate/add space between Liquid Glass toolbar items when using ToolbarOverflowMenu
When optimizing for iPhone Duo (and in general) I understand the recommendation is to replace custom More (...) menus with the system overflow menu, otherwise it's possible you can see two (...) buttons or get the custom menu nested inside the system overflow menu. Eek. With the following code, both (+) and (...) are unexpectedly inside one shared Liquid Glass background. How do you separate / add space between them or is this a bug, if so is there a workaround? struct ContentView: View { var body: some View { NavigationStack { Text("Hello, World") .toolbar { ToolbarItem { Button("Add", systemImage: "plus") { } } ToolbarSpacer(.fixed) ToolbarOverflowMenu { Button("Settings", systemImage: "gearshape") { } } } } } } Here's my original code that display two separate buttons as expected: struct ContentView: View { var body: some View { NavigationStack { Text("Hello, World") .toolbar { ToolbarItem { Button("Add", systemImage: "plus") { } } ToolbarSpacer(.fixed) ToolbarItem { Menu { Button("Settings", systemImage: "gearshape") { } } label: { Label("More", systemImage: "ellipsis") } } } } } } Why do I care you might ask? When the user turns on filters in my app, a filter toolbar item is shown, and I want the (+) to remain separate from the grouped filter and more buttons. (+) is like the primary action that should stand alone, like it does in the Wallet app.
Topic: UI Frameworks SubTopic: SwiftUI
3
1
98
2d
About wallpaper app for iPhone Duo
I'm building a wallpaper app for iPhone Duo. The outer display is portrait (1398×2034), and the unfolded inner display is landscape (2670×1878). My wallpapers are portrait images — for example, a person centered in the frame. When the user unfolds the device and the screen changes from portrait to landscape, how does iOS adapt the wallpaper? Specifically: Does it crop a landscape region from the portrait image (which could cut off the subject)? Does it preserve the focal point the user chose when setting the wallpaper, keeping the subject in frame? Or can separate images be assigned to the outer and inner displays? I need to understand this behavior to decide what compositions to offer in my app.
Topic: UI Frameworks SubTopic: SwiftUI
1
0
54
2d
How to limit SwiftUI PasteButton for custom URLs?
For GNU Taler, we defined a custom URL scheme: "taler://". We want to have a SwiftUI PasteButton in our app which is only active/enabled when the user copied a talerURI, but not for other URIs (such as https:// or mailto://). Currently we use PasteButton(supportedContentTypes: [.url]) { providers in which works, but is also enabled when the copied text is some other URI, not only for "taler://". Can we define a UTType ".taler" for PasteButton to check whether the pasteBoard has indeed a talerURI? How?
Topic: UI Frameworks SubTopic: SwiftUI
2
0
438
2d
Upside down portrait?
I know iPhone without a home button do not support portrait upside down display, but it seems that this would be very useful on the Duo. Especially if it's upside down when the user closes it. The simulators in 27.1 bets do not seem to support this. Is there a plan to support upside down portrait on the iPhone Duo? Left handed people may appreciate it.
Topic: UI Frameworks SubTopic: SwiftUI
2
0
26
2d
Duo not having different z index with overlay arrangement view style
When using ArrangementView with the overlay style, the Duo simulator does not appear to return a distinct z-index environment value, though it correctly displays z-index 0 and 1 on other iPhone simulators. I would like to use this value to determine whether the overlay is active. Currently, this does not seem possible. Is this behavior intended, or is it a bug? If intended, what is the recommended approach to determine if the Duo is displaying the arranged view over another arranged view? import SwiftUI struct ContentView: View { var body: some View { ArrangementView { Controls() } secondary: { Player() } .arrangementViewStyle(.overlay) } } struct Controls: View { @Environment(\.overlayArrangementZIndex) var zIndex var body: some View { Text("Controls Z:\(zIndex)") .frame(maxWidth: .infinity, alignment: .leading) } } struct Player: View { @Environment(\.overlayArrangementZIndex) var zIndex var body: some View { Text("Player Z:\(zIndex)") .frame(maxWidth: .infinity, alignment: .trailing) } } #Preview { ContentView() }
Topic: UI Frameworks SubTopic: SwiftUI
2
0
68
2d
Handling multi-pass layout updates and debounce strategies during fold/unfold animations
During physical articulation transitions, view bounds, safe areas, and reserved regions frequently resolve across distinct sequential layout passes. In declarative SwiftUI hierarchies, this transient intermediate state can trigger view destruction and recreation if subviews are conditionally bound to active divisions. What is the official guidance for stabilizing view state across these asynchronous layout passes? Should coordinators implement client-side debouncing, or does SwiftUI provide layout primitives to smoothly bridge views across active-to-inactive division transitions without dropping view identity or resetting active tasks?
Topic: UI Frameworks SubTopic: SwiftUI
1
0
38
2d
safeAreaBar and the Fold
When using safeAreaBar, what’s the best way to keep its content on just one side of the fold in book mode? Would you recommend using the .division reserved region to adjust the layout manually, or is there a more built-in SwiftUI approach?
Topic: UI Frameworks SubTopic: SwiftUI
5
0
129
2d
Best practice for responding to the hinge angle in SwiftUI: Semantic modifiers vs. ReservedRegion queries
Hello! The session description mentions "responding to the hinge angle" in SwiftUI. In the current iOS 27.1 SDK surface, physical division detection relies primarily on inspecting GeometryProxy.reservedRegions(kind: .division). Could you clarify whether Apple recommends modeling posture strictly through geometric division queries, or if there is a recommended/upcoming approach (such as a dedicated view modifier, environment value, or semantic posture state) to observe chassis articulation directly? If continuous or discrete angles are accessible, what is the canonical way to drive declarative layout changes without incurring redundant body re-evaluations during active folding?
Topic: UI Frameworks SubTopic: SwiftUI
1
0
64
2d
How to Keep Out a Tinted navigationbar from the Combined Status Bar Region in iPhone Duo using Swiftui
I think the title says it all.
Replies
1
Boosts
0
Views
58
Activity
4h
Can a Notes note be dragged into another app on iPhone Duo?
I’m adding drag-and-drop support to my app for multitasking on iPhone Duo. My app supports text/note content. Currently, a user can move content from Apple Notes into my app using Share or Copy/Paste. ** Questions** Can a note from the Notes app be dragged directly into another app during multitasking, similar to dragging a photo? If so, what content type does Notes provide through the drag-and-drop session? For example, is the note exposed as plain text (public.plain-text / UTType.plainText), rich text, or another transferable type? My goal is for the user to drag a note from Notes into my app and have it behave essentially like Copy → Paste, without requiring the Share sheet. Thank you.
Replies
0
Boosts
0
Views
31
Activity
6h
SwiftUI Document API Duplicate Function hangs on macOS 27
In a macOS 27 app using DocumentGroup(editor:makeDocument:) with a type conforming to the new Document protocol, choosing File › Duplicate hangs the app permanently (0% CPU, spinning beach ball, must force quit). The main thread is blocked in URLPlatformDocument.read(from:ofType:) waiting on a dispatch semaphore. That synchronous NSDocument read path is reached from NSDocumentController.duplicateDocumentWithContentsOfURL(:copying:displayName:) → makeDocumentForURL(:withContentsOf:ofType:) → NSDocument.init(for:withContentsOf:ofType:). The work the semaphore waits for never runs: the app's makeDocument closure is never called. The SDK declares makeDocument and ReadableDocument.apply(snapshot:previous:) as @MainActor, so blocking the main thread while waiting for them can never complete. This reproduces with Apple's unmodified sample code project "Building a Document-Based App with SwiftUI" (no code or project changes; only a signing team set). Our own app, which uses a custom DocumentReader/DocumentWriter with Source/Destination == URL, hangs with the identical stack. Has anyone found any workaround? Filed Feedback FB24949862
Topic: UI Frameworks SubTopic: SwiftUI
Replies
0
Boosts
0
Views
27
Activity
7h
sidebarAdaptable Design Problem
This is what Apple's Destination Video Sample App looks like on iPhone Duo built with SDK 27.1 beta. Two things: Items that should not appear in the tab bar appear. There is no sidebar for iPhone Duo. So my problem is: is this a bug or a design on purpose? Will sidebarAdaptable gets a sidebar on iPhone Duo? Or at least, how to hide these things that should only appear in the sidebar? The sample app uses .defaultVisibility(, for:) and .hidden() but obviously none of these takes effect.
Topic: UI Frameworks SubTopic: SwiftUI
Replies
1
Boosts
1
Views
170
Activity
7h
Supported way to put an iPhone Duo simulator into the unfolded state programmatically
The Duo simulator boots showing only the outer display: the window is fixed at 382×644 pt and our layout classifier always reports the compact stack mode. We measured this on two separate clean boots (shutdown, erase, boot). xcrun simctl help lists no subcommand for folding, posture, or selecting the inner display — we read the full list. xcrun simctl io screenshot does reveal a second display (LCD-1, 2007×2853 px, aspect 0.70, close to the 669×951 inner portrait size). Unfolding manually in the Simulator UI works and the app then renders the two-column layout correctly, but we could not find a programmatic equivalent. Is there a supported way to unfold a Duo simulator from the command line or from XCTest?
Topic: UI Frameworks SubTopic: SwiftUI
Replies
3
Boosts
3
Views
702
Activity
1d
Enable iPhone Duo Upside Down Orientation
Ever since the iPhone X, upside-down orientation on the iPhone has been disabled by design. I haven't found any official documentation explaining why, but my guess is it has to do with Face ID and the top notch. However, now that the iPhone Duo has no Face ID or notch—and includes reserved occlusion regions—why not enable upside-down rotation? As of iOS 27.1, it remains disabled. Leaving it turned off only confuses users, making them think their favorite apps are frozen when they won't rotate.
Topic: UI Frameworks SubTopic: SwiftUI
Replies
1
Boosts
1
Views
308
Activity
1d
iPhone Duo and the Safe-Area
I took a screenshot of the Safety Area's and Occlusions on the iPhone Duo outer display. The article Designing for iPhone Duo tells us to... Consider using the full display width for interfaces where bars aren’t necessary. Some layouts can span the full display, which works well for visual, immersive interfaces that don’t scroll, as long as nothing conflicts with the Dynamic Island or the status bar. Calculator, for example, occupies the full width of the display. You can also combine both approaches, letting a background image or header span the full width while scrollable content stays inset. The Graphics Content can easily take up the full space which can be achieved by ignoring the safe area (.ignoresSafeArea()). And knowing the iPhone Duo there is no occlusion so I can also ignore the safe area for the interactable content. However we now are entering an awkward state. Because now I need to make decisions based on a specific device. Knowing the iPhone Duo I can ignore horizontal safe area and expand to full width because there is no occlusions here, but ignoring the safe-area may result in unexpected behavior on other (future) devices which then requires me to use code that specificly targets certain devices. I wished SwiftUI had something that I could safely expand the interactable content the full width.
Topic: UI Frameworks SubTopic: SwiftUI
Replies
2
Boosts
0
Views
105
Activity
1d
Charts are broken with Xcode 27, Plotting multiple lines
Hi, Charts—specifically those with multiple lines—are broken in Xcode 27. First, I spotted the bug in my program, and then I checked your example. Your own example Plotting-multiple-lines is not working correctly anymore. It shows 1 line or sometimes no lines at all, depending on the order of the data. It depends on how the data is passed to the chart. If the data is passed as separate series, it works. In Visualizing your app’s data it works, but the data is passed as described before. Don't follow Microslop: have the AI ​​generate the code and then skip the tests. This is a serious bug that requires a lot of work to rearrange the data, just to work around the issue. Christian
Replies
0
Boosts
0
Views
221
Activity
1d
App Intents and the Document App Xcode Template
I’m working on an app that deals with a list of text items, so I started with the document app template in Xcode. I have the app basically doing what I want it to do, but I want to be a good ecosystem citizen, so I’d like to conform to app intents. I think that app intents will able to do what I want - accepting text and passing it back out - but I can’t figure out how to access the document outside of my content view and associated subviews. Any guidance would be appreciated. Thank you, Don Carlile
Replies
1
Boosts
0
Views
404
Activity
2d
How to implement correct horizontal padding for iPhone Duo
The iPhone Duo outer screen displays a vertical bar on the right edge with view contents inset. A SwiftUI Form displays an appropriate amount of leading padding but 0 padding on the trailing edge, since the vertical bar provides some visual margins already that looks nice. I have a view that looks kind of like a form, multiple stacked text fields, that should align the same way. I used scenePadding to achieve which looks correct on iPhone 18 Pro perfectly aligned with Form, but on iPhone Duo there is extra trailing padding. It doesn't align with my Edit button that remains in the horizontal axis navigation bar (and it is not inset enough on the leading edge, off by a few pixels, interestingly). Note when you unfold it and add the app on the left side in Split View, the vertical bar is on the leading edge, in which case there's too much padding on the leading edge. How can I achieve the correct layout padding/margins? iPhone 18 Pro vs iPhone Duo: My actual app: struct ContentView: View { var body: some View { TabView { NavigationStack { SystemFormView() .navigationTitle("System Form") } .tabItem { Label("System Form", systemImage: "list.bullet.rectangle") } NavigationStack { CustomFormView() .navigationTitle("Custom Form") } .tabItem { Label("Custom Form", systemImage: "rectangle.3.group") } } } } private struct SystemFormView: View { var body: some View { Form { Text("Row 1") Text("Row 2") Text("Row 3") } } } private struct CustomFormView: View { var body: some View { ScrollView { VStack(spacing: 0) { customRow("Row 1") Divider() .padding(.leading) customRow("Row 2") Divider() .padding(.leading) customRow("Row 3") } .background(.background) .scenePadding(.horizontal) } .background(Color(uiColor: .systemGroupedBackground)) } private func customRow(_ title: LocalizedStringKey) -> some View { Text(title) .frame(maxWidth: .infinity, minHeight: 44, alignment: .leading) .padding(.horizontal) } } Note in UIKit, UITableViewController with the inset grouped style has the same layout as Form. A custom view hierarchy can achieve the exact same placement/padding/margins by following these steps: create a scroll view and a content view, set preservesSuperviewLayoutMargins = true on both views, constrain the scroll view to the root view on all edges, constrain the content view to the scrollView.contentLayoutGuide on all edges, constrain the content view width anchor to the scrollView.frameLayoutGuide.widthAnchor, then constrain subviews of the content view to the contentView.layoutMarginsGuide. So I know how to do it in UIKit, how do we in SwiftUI? Thanks!
Topic: UI Frameworks SubTopic: SwiftUI
Replies
3
Boosts
1
Views
169
Activity
2d
How to separate/add space between Liquid Glass toolbar items when using ToolbarOverflowMenu
When optimizing for iPhone Duo (and in general) I understand the recommendation is to replace custom More (...) menus with the system overflow menu, otherwise it's possible you can see two (...) buttons or get the custom menu nested inside the system overflow menu. Eek. With the following code, both (+) and (...) are unexpectedly inside one shared Liquid Glass background. How do you separate / add space between them or is this a bug, if so is there a workaround? struct ContentView: View { var body: some View { NavigationStack { Text("Hello, World") .toolbar { ToolbarItem { Button("Add", systemImage: "plus") { } } ToolbarSpacer(.fixed) ToolbarOverflowMenu { Button("Settings", systemImage: "gearshape") { } } } } } } Here's my original code that display two separate buttons as expected: struct ContentView: View { var body: some View { NavigationStack { Text("Hello, World") .toolbar { ToolbarItem { Button("Add", systemImage: "plus") { } } ToolbarSpacer(.fixed) ToolbarItem { Menu { Button("Settings", systemImage: "gearshape") { } } label: { Label("More", systemImage: "ellipsis") } } } } } } Why do I care you might ask? When the user turns on filters in my app, a filter toolbar item is shown, and I want the (+) to remain separate from the grouped filter and more buttons. (+) is like the primary action that should stand alone, like it does in the Wallet app.
Topic: UI Frameworks SubTopic: SwiftUI
Replies
3
Boosts
1
Views
98
Activity
2d
About wallpaper app for iPhone Duo
I'm building a wallpaper app for iPhone Duo. The outer display is portrait (1398×2034), and the unfolded inner display is landscape (2670×1878). My wallpapers are portrait images — for example, a person centered in the frame. When the user unfolds the device and the screen changes from portrait to landscape, how does iOS adapt the wallpaper? Specifically: Does it crop a landscape region from the portrait image (which could cut off the subject)? Does it preserve the focal point the user chose when setting the wallpaper, keeping the subject in frame? Or can separate images be assigned to the outer and inner displays? I need to understand this behavior to decide what compositions to offer in my app.
Topic: UI Frameworks SubTopic: SwiftUI
Replies
1
Boosts
0
Views
54
Activity
2d
Do GeometryReader and containerRelativeFrame Need to Be Replaced for iPhone Duo Support?
Is it necessary to replace GeometryReader and containerRelativeFrame in preparation for iPhone Duo support? If so, could you let me know the best way to do it.
Topic: UI Frameworks SubTopic: SwiftUI
Replies
2
Boosts
0
Views
79
Activity
2d
How to limit SwiftUI PasteButton for custom URLs?
For GNU Taler, we defined a custom URL scheme: "taler://". We want to have a SwiftUI PasteButton in our app which is only active/enabled when the user copied a talerURI, but not for other URIs (such as https:// or mailto://). Currently we use PasteButton(supportedContentTypes: [.url]) { providers in which works, but is also enabled when the copied text is some other URI, not only for "taler://". Can we define a UTType ".taler" for PasteButton to check whether the pasteBoard has indeed a talerURI? How?
Topic: UI Frameworks SubTopic: SwiftUI
Replies
2
Boosts
0
Views
438
Activity
2d
Upside down portrait?
I know iPhone without a home button do not support portrait upside down display, but it seems that this would be very useful on the Duo. Especially if it's upside down when the user closes it. The simulators in 27.1 bets do not seem to support this. Is there a plan to support upside down portrait on the iPhone Duo? Left handed people may appreciate it.
Topic: UI Frameworks SubTopic: SwiftUI
Replies
2
Boosts
0
Views
26
Activity
2d
Is the hinge area always un-tappable, or only when the device is folded
I noticed the hinge keep out has an isActive status on it. does that mean the hinge area is only un-tappable when it is active? As in, when the device is open 100%, the hinge area can receive taps? Same for the camera cutout on the inside screen, I assume it's only active when the camera is being used?
Topic: UI Frameworks SubTopic: SwiftUI
Replies
0
Boosts
0
Views
29
Activity
2d
Duo not having different z index with overlay arrangement view style
When using ArrangementView with the overlay style, the Duo simulator does not appear to return a distinct z-index environment value, though it correctly displays z-index 0 and 1 on other iPhone simulators. I would like to use this value to determine whether the overlay is active. Currently, this does not seem possible. Is this behavior intended, or is it a bug? If intended, what is the recommended approach to determine if the Duo is displaying the arranged view over another arranged view? import SwiftUI struct ContentView: View { var body: some View { ArrangementView { Controls() } secondary: { Player() } .arrangementViewStyle(.overlay) } } struct Controls: View { @Environment(\.overlayArrangementZIndex) var zIndex var body: some View { Text("Controls Z:\(zIndex)") .frame(maxWidth: .infinity, alignment: .leading) } } struct Player: View { @Environment(\.overlayArrangementZIndex) var zIndex var body: some View { Text("Player Z:\(zIndex)") .frame(maxWidth: .infinity, alignment: .trailing) } } #Preview { ContentView() }
Topic: UI Frameworks SubTopic: SwiftUI
Replies
2
Boosts
0
Views
68
Activity
2d
Handling multi-pass layout updates and debounce strategies during fold/unfold animations
During physical articulation transitions, view bounds, safe areas, and reserved regions frequently resolve across distinct sequential layout passes. In declarative SwiftUI hierarchies, this transient intermediate state can trigger view destruction and recreation if subviews are conditionally bound to active divisions. What is the official guidance for stabilizing view state across these asynchronous layout passes? Should coordinators implement client-side debouncing, or does SwiftUI provide layout primitives to smoothly bridge views across active-to-inactive division transitions without dropping view identity or resetting active tasks?
Topic: UI Frameworks SubTopic: SwiftUI
Replies
1
Boosts
0
Views
38
Activity
2d
safeAreaBar and the Fold
When using safeAreaBar, what’s the best way to keep its content on just one side of the fold in book mode? Would you recommend using the .division reserved region to adjust the layout manually, or is there a more built-in SwiftUI approach?
Topic: UI Frameworks SubTopic: SwiftUI
Replies
5
Boosts
0
Views
129
Activity
2d
Best practice for responding to the hinge angle in SwiftUI: Semantic modifiers vs. ReservedRegion queries
Hello! The session description mentions "responding to the hinge angle" in SwiftUI. In the current iOS 27.1 SDK surface, physical division detection relies primarily on inspecting GeometryProxy.reservedRegions(kind: .division). Could you clarify whether Apple recommends modeling posture strictly through geometric division queries, or if there is a recommended/upcoming approach (such as a dedicated view modifier, environment value, or semantic posture state) to observe chassis articulation directly? If continuous or discrete angles are accessible, what is the canonical way to drive declarative layout changes without incurring redundant body re-evaluations during active folding?
Topic: UI Frameworks SubTopic: SwiftUI
Replies
1
Boosts
0
Views
64
Activity
2d