Explore the various UI frameworks available for building app interfaces. Discuss the use cases for different frameworks, share best practices, and get help with specific framework-related questions.

All subtopics
Posts under UI Frameworks topic

Post

Replies

Boosts

Views

Activity

Does folding send the same scene callbacks as backgrounding the app?
We resume location and refresh Home from sceneDidBecomeActive, and we ignore that callback while Apple Pay is up because dismissing PKPaymentAuthorizationController also makes the scene active. Does a fold or unfold call sceneWillResignActive, sceneDidEnterBackground, or sceneDidBecomeActive? If the user folds during Apple Pay, does the payment sheet dismiss and complete, or stay up on the other display?
Topic: UI Frameworks SubTopic: UIKit
0
0
41
6d
Managing Empty Space When Positioning an App on the Side in Dual-Window Mode
Hi everyone, I’m developing an iOS application and I’m wondering whether it is possible to position the app on either the left or right side of the screen when running in a dual-window/multitasking configuration. If the app does not occupy the entire screen, can I customize the remaining empty space by assigning a background color or displaying an image? Additionally, if I place a visual element or background in the central/remaining area, could this cause any issues with touch interaction or hit-testing? In particular, I’d like to understand whether the system would still correctly route touch events to the active application, or whether the additional area could interfere with the app’s clickable elements.
Topic: UI Frameworks SubTopic: SwiftUI
1
0
53
6d
What happens to the camera if the device folds while it is open?
The QR scanner uses AVCaptureSession and an AVCaptureVideoPreviewLayer framed to the view bounds. Different screens present UIImagePickerController with source type .camera. If the user folds or unfolds while either is visible, which camera stays active, does the preview orientation and frame update, and is the picker dismissed or left at the old display size?
Topic: UI Frameworks SubTopic: UIKit
0
2
55
6d
Can a modal fill the whole inner screen?
In our app we have situations where the user may be blocked for security reasons and we currently present a full screen modal - can we fill the screen with a modal in such a situation on Duo if the app is full screen on the inner display?
Topic: UI Frameworks SubTopic: UIKit
1
1
75
6d
Do action sheets, share sheets, and document pickers need a popover anchor on the inner display?
Camera, gallery, and PDF choices use UIAlertController style .actionSheet with no popover source. Receipt sharing uses UIActivityViewController, and uploads use UIDocumentPickerViewController; only some set sourceView, and almost none set a real sourceRect. On iPad those presentations need an anchor. On the unfolded Duo display, where the size class is regular, does UIKit still present them as phone sheets, or must every one set sourceView and sourceRect?
Topic: UI Frameworks SubTopic: UIKit
0
0
48
6d
Does GeometryReader-based content-height caching need manual invalidation on an iPhone Duo pose change?
We use a PreferenceKey-based pattern to measure real per-row content height in a List (via an invisible .background(GeometryReader { ... }) per row), caching the result in @State keyed by row index, since a fixed height estimate wasn't reliable. This is a common SwiftUI technique, not iPhone-Duo-specific. Apple's guidance on GeometryProxy.reservedRegion covers fold-aware layout for regions affected by the hinge, but I haven't found guidance on whether a live pose change (open → folded, or vice versa, without a relaunch) automatically invalidates cached measurements taken via a PreferenceKey at first layout, or whether SwiftUI's dependency tracking doesn't propagate that kind of external geometry change and the cache needs to be explicitly cleared on a pose-change notification. Is there a specific environment value or notification to observe for "the window's available geometry changed due to a fold event," separate from the standard horizontal/vertical size-class change?
Topic: UI Frameworks SubTopic: SwiftUI
0
1
17
6d
Best practice for safe area / status bar height differences between cover and inner displays
The cover and inner displays have different aspect ratios and (presumably) different safe area insets/notch or camera cutout geometry. Is there guidance on how safe area layout guides should behave across the fold transition — do they update automatically as part of the same trait-change/relayout pass, or do we need to explicitly recompute cached safe-area-derived constants (we currently cache statusBarHeight off the "foreground active" window scene)?
Topic: UI Frameworks SubTopic: UIKit
0
0
51
6d
UIWindowScene.ActivationAction
What exactly is the UIWindowScene.ActivationAction and if I have multiple scenes when would ever a point be that a new window would be triggered on the front screen (closed) such that there would be an error? Do I really need to do something with this?
Topic: UI Frameworks SubTopic: UIKit
0
0
9
6d
Recommended way to keep a custom radial/gradient CALayer in sync during the fold transition
We have a CALayer subclass performing custom draw(in:) rendering (a radial gradient) behind a card view, resized via viewDidLayoutSubviews. For an ordinary rotation we sync it inside coordinator.animate(alongsideTransition:). If the fold/unfold transition doesn't go through viewWillTransition at all (per Q1), what is the recommended hook to animate custom CALayer content smoothly across this specific transition, given it appears to involve a scene relocation rather than a resize?
Topic: UI Frameworks SubTopic: UIKit
0
0
44
6d
Official HIG guidance for adaptive layout between a foldable iPhone's cover and inner displays
Beyond the general iPad/regular-width adaptive layout guidance, is there foldable-specific HIG guidance for what should change (or must not change) between the compact cover-screen layout and the regular-width inner-screen layout — particularly around navigation patterns (tab bar vs. sidebar), modal presentation styles, and content reflow expectations?
Topic: UI Frameworks SubTopic: SwiftUI
0
0
6
6d
Keyboard avoidance for an inset sheet on the inner display
On the folded phone the keyboard resizes our edge-to-edge sheet. On the inner display the sheet is inset, and keyboardFrameEnd in screen coordinates no longer lines up with the sheet’s container, so input fields stay covered. Should we convert the keyboard frame into the sheet’s coordinate space, and does keyboardLayoutGuide follow the sheet or the screen on iPhone Duo?
Topic: UI Frameworks SubTopic: UIKit
0
0
47
6d
Where can we find the official WWDC session / sample code for adopting the foldable iPhone (this generation's Duo hardware)?
We've been reverse-engineering behavior from the Simulator device profile alone. Is there a WWDC session, updated UIKit/SwiftUI documentation, or sample project specifically covering foldable iPhone adoption (window/scene handling, size-class behavior, collection/table view sizing, and the fold-posture API surface) that we should be building against instead of inferring behavior empirically?
Topic: UI Frameworks SubTopic: UIKit
0
0
38
6d
Confirming iPhone Duo is modeled as two separate UIScreens, not one resizable screen
on the iPhone Duo simulator reports two distinct "Integrated" screens ("LCD" at 1398×2034 and "LCD-1" at 2007×2853), both simultaneously powered on. Is this the correct mental model for the real hardware — a genuine cover display and inner display as separate UIScreen objects — as opposed to one continuously flexible panel whose bounds just change? This significantly affects whether we handle the transition via trait/size-class changes or via UIScreen.didConnectNotification-style multi-screen handling.
Topic: UI Frameworks SubTopic: UIKit
0
1
44
6d
Widgets on each screen
my app widget supports iPhone and iPad. Which widget sizes are available on the outer and inner home screens (including systemExtraLarge)? Does a fold or unfold trigger a new timeline or a re-render?
Topic: UI Frameworks SubTopic: UIKit
0
0
37
6d
Is the fold/unfold transition a window resize, a scene relocation, or a completely new scene?
When toggling between cover and unfolded posture in the iPhone Duo simulator, we observe several seconds of black screen during the transition — much longer than a typical 0.3s rotation animation. Does viewWillTransition(to:with:) fire at all during this transition, or does the OS tear down and recreate the UIWindowScene/UIWindow on the other screen? We need to know which lifecycle hooks are guaranteed to fire so we can update UI state (search width, gradients, cached layout sizes) at the right time.
Topic: UI Frameworks SubTopic: UIKit
0
1
42
6d
Does folding send the same scene callbacks as backgrounding the app?
We resume location and refresh Home from sceneDidBecomeActive, and we ignore that callback while Apple Pay is up because dismissing PKPaymentAuthorizationController also makes the scene active. Does a fold or unfold call sceneWillResignActive, sceneDidEnterBackground, or sceneDidBecomeActive? If the user folds during Apple Pay, does the payment sheet dismiss and complete, or stay up on the other display?
Topic: UI Frameworks SubTopic: UIKit
Replies
0
Boosts
0
Views
41
Activity
6d
Managing Empty Space When Positioning an App on the Side in Dual-Window Mode
Hi everyone, I’m developing an iOS application and I’m wondering whether it is possible to position the app on either the left or right side of the screen when running in a dual-window/multitasking configuration. If the app does not occupy the entire screen, can I customize the remaining empty space by assigning a background color or displaying an image? Additionally, if I place a visual element or background in the central/remaining area, could this cause any issues with touch interaction or hit-testing? In particular, I’d like to understand whether the system would still correctly route touch events to the active application, or whether the additional area could interfere with the app’s clickable elements.
Topic: UI Frameworks SubTopic: SwiftUI
Replies
1
Boosts
0
Views
53
Activity
6d
What happens to the camera if the device folds while it is open?
The QR scanner uses AVCaptureSession and an AVCaptureVideoPreviewLayer framed to the view bounds. Different screens present UIImagePickerController with source type .camera. If the user folds or unfolds while either is visible, which camera stays active, does the preview orientation and frame update, and is the picker dismissed or left at the old display size?
Topic: UI Frameworks SubTopic: UIKit
Replies
0
Boosts
2
Views
55
Activity
6d
Can a modal fill the whole inner screen?
In our app we have situations where the user may be blocked for security reasons and we currently present a full screen modal - can we fill the screen with a modal in such a situation on Duo if the app is full screen on the inner display?
Topic: UI Frameworks SubTopic: UIKit
Replies
1
Boosts
1
Views
75
Activity
6d
Do action sheets, share sheets, and document pickers need a popover anchor on the inner display?
Camera, gallery, and PDF choices use UIAlertController style .actionSheet with no popover source. Receipt sharing uses UIActivityViewController, and uploads use UIDocumentPickerViewController; only some set sourceView, and almost none set a real sourceRect. On iPad those presentations need an anchor. On the unfolded Duo display, where the size class is regular, does UIKit still present them as phone sheets, or must every one set sourceView and sourceRect?
Topic: UI Frameworks SubTopic: UIKit
Replies
0
Boosts
0
Views
48
Activity
6d
Does GeometryReader-based content-height caching need manual invalidation on an iPhone Duo pose change?
We use a PreferenceKey-based pattern to measure real per-row content height in a List (via an invisible .background(GeometryReader { ... }) per row), caching the result in @State keyed by row index, since a fixed height estimate wasn't reliable. This is a common SwiftUI technique, not iPhone-Duo-specific. Apple's guidance on GeometryProxy.reservedRegion covers fold-aware layout for regions affected by the hinge, but I haven't found guidance on whether a live pose change (open → folded, or vice versa, without a relaunch) automatically invalidates cached measurements taken via a PreferenceKey at first layout, or whether SwiftUI's dependency tracking doesn't propagate that kind of external geometry change and the cache needs to be explicitly cleared on a pose-change notification. Is there a specific environment value or notification to observe for "the window's available geometry changed due to a fold event," separate from the standard horizontal/vertical size-class change?
Topic: UI Frameworks SubTopic: SwiftUI
Replies
0
Boosts
1
Views
17
Activity
6d
Does the foldable iPhone report as UIUserInterfaceIdiom.phone or .pad in each posture?
Given the size-class behavior mirrors iPad in the unfolded state, does UIDevice.current.userInterfaceIdiom (and UITraitCollection.userInterfaceIdiom) still report .phone in both postures, or does it change to .pad-like when unfolded? This affects any idiom-based branching in our codebase.
Topic: UI Frameworks SubTopic: UIKit
Replies
0
Boosts
0
Views
50
Activity
6d
Why do some buttons move to the vertical bar while others do not?
Which parameters are exactly used to decide which controls are moving to the vertical bar? What are they (which priorities, other properties are used for that decision?)
Topic: UI Frameworks SubTopic: UIKit
Replies
1
Boosts
0
Views
74
Activity
6d
Best practice for safe area / status bar height differences between cover and inner displays
The cover and inner displays have different aspect ratios and (presumably) different safe area insets/notch or camera cutout geometry. Is there guidance on how safe area layout guides should behave across the fold transition — do they update automatically as part of the same trait-change/relayout pass, or do we need to explicitly recompute cached safe-area-derived constants (we currently cache statusBarHeight off the "foreground active" window scene)?
Topic: UI Frameworks SubTopic: UIKit
Replies
0
Boosts
0
Views
51
Activity
6d
UIWindowScene.ActivationAction
What exactly is the UIWindowScene.ActivationAction and if I have multiple scenes when would ever a point be that a new window would be triggered on the front screen (closed) such that there would be an error? Do I really need to do something with this?
Topic: UI Frameworks SubTopic: UIKit
Replies
0
Boosts
0
Views
9
Activity
6d
Recommended way to keep a custom radial/gradient CALayer in sync during the fold transition
We have a CALayer subclass performing custom draw(in:) rendering (a radial gradient) behind a card view, resized via viewDidLayoutSubviews. For an ordinary rotation we sync it inside coordinator.animate(alongsideTransition:). If the fold/unfold transition doesn't go through viewWillTransition at all (per Q1), what is the recommended hook to animate custom CALayer content smoothly across this specific transition, given it appears to involve a scene relocation rather than a resize?
Topic: UI Frameworks SubTopic: UIKit
Replies
0
Boosts
0
Views
44
Activity
6d
Is there a way to script/automate the fold-posture toggle for CI or XCUITest?
he only way we've found to change fold posture is the Simulator app's own toolbar control (cover/flat/bent icons); there's no xcrun simctl subcommand (ui, status_bar, etc. don't cover it) and no XCUITest API we've found. Is there a supported way to drive this programmatically for automated UI testing, the way XCUIDevice.shared.orientation works for rotation?
Topic: UI Frameworks SubTopic: UIKit
Replies
0
Boosts
0
Views
48
Activity
6d
Official HIG guidance for adaptive layout between a foldable iPhone's cover and inner displays
Beyond the general iPad/regular-width adaptive layout guidance, is there foldable-specific HIG guidance for what should change (or must not change) between the compact cover-screen layout and the regular-width inner-screen layout — particularly around navigation patterns (tab bar vs. sidebar), modal presentation styles, and content reflow expectations?
Topic: UI Frameworks SubTopic: SwiftUI
Replies
0
Boosts
0
Views
6
Activity
6d
Keyboard avoidance for an inset sheet on the inner display
On the folded phone the keyboard resizes our edge-to-edge sheet. On the inner display the sheet is inset, and keyboardFrameEnd in screen coordinates no longer lines up with the sheet’s container, so input fields stay covered. Should we convert the keyboard frame into the sheet’s coordinate space, and does keyboardLayoutGuide follow the sheet or the screen on iPhone Duo?
Topic: UI Frameworks SubTopic: UIKit
Replies
0
Boosts
0
Views
47
Activity
6d
Does content state (scroll position, selected tab, in-progress form input) persist automatically across the fold transition, or must apps restore it manually?
Does content state (scroll position, selected tab, in-progress form input) persist automatically across the fold transition, or must apps restore it manually?
Topic: UI Frameworks SubTopic: UIKit
Replies
0
Boosts
0
Views
37
Activity
6d
Where can we find the official WWDC session / sample code for adopting the foldable iPhone (this generation's Duo hardware)?
We've been reverse-engineering behavior from the Simulator device profile alone. Is there a WWDC session, updated UIKit/SwiftUI documentation, or sample project specifically covering foldable iPhone adoption (window/scene handling, size-class behavior, collection/table view sizing, and the fold-posture API surface) that we should be building against instead of inferring behavior empirically?
Topic: UI Frameworks SubTopic: UIKit
Replies
0
Boosts
0
Views
38
Activity
6d
Confirming iPhone Duo is modeled as two separate UIScreens, not one resizable screen
on the iPhone Duo simulator reports two distinct "Integrated" screens ("LCD" at 1398×2034 and "LCD-1" at 2007×2853), both simultaneously powered on. Is this the correct mental model for the real hardware — a genuine cover display and inner display as separate UIScreen objects — as opposed to one continuously flexible panel whose bounds just change? This significantly affects whether we handle the transition via trait/size-class changes or via UIScreen.didConnectNotification-style multi-screen handling.
Topic: UI Frameworks SubTopic: UIKit
Replies
0
Boosts
1
Views
44
Activity
6d
Widgets on each screen
my app widget supports iPhone and iPad. Which widget sizes are available on the outer and inner home screens (including systemExtraLarge)? Does a fold or unfold trigger a new timeline or a re-render?
Topic: UI Frameworks SubTopic: UIKit
Replies
0
Boosts
0
Views
37
Activity
6d
Order of viewWillTransition and traitCollectionDidChange when folding
On fold we see both a size transition and a horizontal size-class change, but not always in the same order, and sometimes only one of them. We update tab-bar visibility in both. Which one is guaranteed for a fold, and should geometry updates happen only inside the transition coordinator’s alongsideTransition block?
Topic: UI Frameworks SubTopic: UIKit
Replies
0
Boosts
0
Views
41
Activity
6d
Is the fold/unfold transition a window resize, a scene relocation, or a completely new scene?
When toggling between cover and unfolded posture in the iPhone Duo simulator, we observe several seconds of black screen during the transition — much longer than a typical 0.3s rotation animation. Does viewWillTransition(to:with:) fire at all during this transition, or does the OS tear down and recreate the UIWindowScene/UIWindow on the other screen? We need to know which lifecycle hooks are guaranteed to fire so we can update UI state (search width, gradients, cached layout sizes) at the right time.
Topic: UI Frameworks SubTopic: UIKit
Replies
0
Boosts
1
Views
42
Activity
6d