JUST ENDED
|

iPhone Duo UIKit Q&A

Visit the Apple Developer Forums to discuss adapting your UIKit app to iPhone Duo. Learn about size classes and trait collections, asymmetric safe area insets and layout margins, reserved regions and arrangements, Split View and tab bar behavior, and responding to the hinge angle.

Post

Replies

Boosts

Views

Activity

inputAccessoryView and vertical toolbars
My app has a small inputAccessoryView that does not fill the width of the screen above the keyboard. On iPhone Duo with a vertical toolbar, tapping in my text view to bring up the keyboard will collapse all bar buttons that are obscured by the keyboard and any that intersect the vertical space of my inputAccessoryView, even though the inputAccessoryView does not visually overlap the vertical bar. Is there a way to keep more bar buttons on screen?
Topic: UI Frameworks SubTopic: UIKit
0
0
15
8h
Partially folded pose and UITabAccessory
When the inner screen on iPhone Duo is partially folded and horizontal, what is the best practice to make the UITabAccessory adapt ? How to make it shift to the left or to the right screen and how to size it properly in that case ?
Topic: UI Frameworks SubTopic: UIKit
1
0
29
9h
Moving view (or button) off centre of the screen when iPhone Duo is half-folded.
We're supposed to keep away from the centre of the screen when Duo is half-folded (some sort of book / laptop-like pose). How do I do it in a right/intended by UIKit engineers way? Sub-Questions below: a) What's the proper way in UIKit, if I only have a frame of region? b) How to understand if division region is vertical or horizontal, and where shall i move my controls out of center? c) Do we get any layout guides for that?
Topic: UI Frameworks SubTopic: UIKit
1
1
59
9h
Keyboard extensions and reserved regions
I have a keyboard extension in my app and I'm seeing some inconsistent behavior with the system-provided Globe and Dictation buttons. For the system keyboards, these buttons are displayed to the side of the keyboard, insetting the bottom row of keys on the folded screen and insetting the entire keyboard on the unfolded screen. What is the expected behavior for custom keyboards on the folded screen? My test results: When the Duo simulator is folded, sometimes the Globe and Dictation buttons appear next to my keyboard and the entire custom keyboard is squeezed to be really narrow. Other times my UI gets the full width and the Globe and Dictate keys are on TOP of my UI. The latter seems preferable, assuming I can then use the reserved regions API to avoid the overlap. Is that the intent? PS: The reserved regions API doesn't seem to work in keyboard extensions in this beta, neither in SwiftUI or UIKit. Hopefully that's fixed in the next beta.
Topic: UI Frameworks SubTopic: UIKit
0
1
21
9h
Which display is used for launch, Live Activities, and widgets?
Cold launch from a shortcut, universal link, or push is handled in scene(_:willConnectTo:options:). Diiferent functionalities also start Live Activities and reload widgets. If the device is folded, does that scene connect for the outer display, and can the geometry still change before the first frame if the user unfolds? When folded, do Live Activities and widgets appear on the outer display, and is there a separate presentation the app must support?
Topic: UI Frameworks SubTopic: UIKit
0
0
20
9h
Do pushed screens get the fold transition, and how wide should their content be?
Only Home updates layout when the size class changes. Various screens are pushed and set their table and scroll heights once from the screen size. Does every controller in a navigation stack, including ones that are not visible, receive viewWillTransition(to:with:)? For forms and lists on the inner display, is readableContentGuide the width we should use, and does it update during the fold?
Topic: UI Frameworks SubTopic: UIKit
0
0
19
9h
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
17
9h
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
29
9h
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
51
9h
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
21
9h
Guidance on UITabBarController sidebar suppression for foldable iPhone regular-width layouts
On unfolding, our app's horizontalSizeClass becomes .regular, and UITabBarController automatically promotes to the iPadOS-style sidebar. We suppress this with mode = .tabBar (iOS 18+) and sidebar.preferredPlacement = .tabBar / sidebar.preferredLayout = .tile (iOS 27+) to keep a bottom tab bar. Is this the correct/recommended approach for a foldable iPhone's inner display, or is there a foldable-specific tab bar mode we should be using instead?
Topic: UI Frameworks SubTopic: UIKit
0
1
22
9h
Should TARGETED_DEVICE_FAMILY include iPad (2) for an iPhone-only app to properly support the foldable inner display?
Our app declares TARGETED_DEVICE_FAMILY = 1 (iPhone only), yet the unfolded inner display presents a .regular horizontal size class identical to iPad's, and our project also carries a leftover INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad override. Does Apple recommend/require declaring iPad as a supported family for apps that want to support this device properly, or is "iPhone-only + regular size class" the intended long-term model?
Topic: UI Frameworks SubTopic: UIKit
0
1
18
9h
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
22
9h
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
18
10h
inputAccessoryView and vertical toolbars
My app has a small inputAccessoryView that does not fill the width of the screen above the keyboard. On iPhone Duo with a vertical toolbar, tapping in my text view to bring up the keyboard will collapse all bar buttons that are obscured by the keyboard and any that intersect the vertical space of my inputAccessoryView, even though the inputAccessoryView does not visually overlap the vertical bar. Is there a way to keep more bar buttons on screen?
Topic: UI Frameworks SubTopic: UIKit
Replies
0
Boosts
0
Views
15
Activity
8h
Ensuring the UITabBar is always adaptable in all poses ?
In the iPhone Duo horizontal pose full expanded inner screen, we use UITabBarController (set up using the viewControllers property), and the UITabBar is still horizontal when it should be vertical ? What are the best practices to make it always adaptable in all poses ?
Topic: UI Frameworks SubTopic: UIKit
Replies
1
Boosts
0
Views
35
Activity
8h
Partially folded pose and UITabAccessory
When the inner screen on iPhone Duo is partially folded and horizontal, what is the best practice to make the UITabAccessory adapt ? How to make it shift to the left or to the right screen and how to size it properly in that case ?
Topic: UI Frameworks SubTopic: UIKit
Replies
1
Boosts
0
Views
29
Activity
9h
Moving view (or button) off centre of the screen when iPhone Duo is half-folded.
We're supposed to keep away from the centre of the screen when Duo is half-folded (some sort of book / laptop-like pose). How do I do it in a right/intended by UIKit engineers way? Sub-Questions below: a) What's the proper way in UIKit, if I only have a frame of region? b) How to understand if division region is vertical or horizontal, and where shall i move my controls out of center? c) Do we get any layout guides for that?
Topic: UI Frameworks SubTopic: UIKit
Replies
1
Boosts
1
Views
59
Activity
9h
Keyboard extensions and reserved regions
I have a keyboard extension in my app and I'm seeing some inconsistent behavior with the system-provided Globe and Dictation buttons. For the system keyboards, these buttons are displayed to the side of the keyboard, insetting the bottom row of keys on the folded screen and insetting the entire keyboard on the unfolded screen. What is the expected behavior for custom keyboards on the folded screen? My test results: When the Duo simulator is folded, sometimes the Globe and Dictation buttons appear next to my keyboard and the entire custom keyboard is squeezed to be really narrow. Other times my UI gets the full width and the Globe and Dictate keys are on TOP of my UI. The latter seems preferable, assuming I can then use the reserved regions API to avoid the overlap. Is that the intent? PS: The reserved regions API doesn't seem to work in keyboard extensions in this beta, neither in SwiftUI or UIKit. Hopefully that's fixed in the next beta.
Topic: UI Frameworks SubTopic: UIKit
Replies
0
Boosts
1
Views
21
Activity
9h
iPhone Duo support without free-form iPad resizing
Can an iPhone-only app that fully supports iPhone Duo, but is not otherwise optimized for iPad (and is non-universal), opt out of free-form resizing on iPad?
Topic: UI Frameworks SubTopic: UIKit
Replies
1
Boosts
3
Views
52
Activity
9h
Which display is used for launch, Live Activities, and widgets?
Cold launch from a shortcut, universal link, or push is handled in scene(_:willConnectTo:options:). Diiferent functionalities also start Live Activities and reload widgets. If the device is folded, does that scene connect for the outer display, and can the geometry still change before the first frame if the user unfolds? When folded, do Live Activities and widgets appear on the outer display, and is there a separate presentation the app must support?
Topic: UI Frameworks SubTopic: UIKit
Replies
0
Boosts
0
Views
20
Activity
9h
Do pushed screens get the fold transition, and how wide should their content be?
Only Home updates layout when the size class changes. Various screens are pushed and set their table and scroll heights once from the screen size. Does every controller in a navigation stack, including ones that are not visible, receive viewWillTransition(to:with:)? For forms and lists on the inner display, is readableContentGuide the width we should use, and does it update during the fold?
Topic: UI Frameworks SubTopic: UIKit
Replies
0
Boosts
0
Views
19
Activity
9h
Does the iPhone Duo inner display use a regular horizontal size class?
On the unfolded inner display our root view controller’s horizontalSizeClass becomes .regular, the same as iPad. Folded, it is .compact. Is that the supported way to tell the two displays apart, or is there a Duo-specific trait, screen idiom, or UIWindowScene property we should use instead of size class?
Topic: UI Frameworks SubTopic: UIKit
Replies
1
Boosts
0
Views
50
Activity
9h
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
17
Activity
9h
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
29
Activity
9h
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
51
Activity
9h
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
21
Activity
9h
Guidance on UITabBarController sidebar suppression for foldable iPhone regular-width layouts
On unfolding, our app's horizontalSizeClass becomes .regular, and UITabBarController automatically promotes to the iPadOS-style sidebar. We suppress this with mode = .tabBar (iOS 18+) and sidebar.preferredPlacement = .tabBar / sidebar.preferredLayout = .tile (iOS 27+) to keep a bottom tab bar. Is this the correct/recommended approach for a foldable iPhone's inner display, or is there a foldable-specific tab bar mode we should be using instead?
Topic: UI Frameworks SubTopic: UIKit
Replies
0
Boosts
1
Views
22
Activity
9h
Should TARGETED_DEVICE_FAMILY include iPad (2) for an iPhone-only app to properly support the foldable inner display?
Our app declares TARGETED_DEVICE_FAMILY = 1 (iPhone only), yet the unfolded inner display presents a .regular horizontal size class identical to iPad's, and our project also carries a leftover INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad override. Does Apple recommend/require declaring iPad as a supported family for apps that want to support this device properly, or is "iPhone-only + regular size class" the intended long-term model?
Topic: UI Frameworks SubTopic: UIKit
Replies
0
Boosts
1
Views
18
Activity
9h
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
18
Activity
9h
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
41
Activity
9h
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
22
Activity
9h
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
18
Activity
10h
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
22
Activity
10h