-
Prepare your app for iPhone Duo
Learn how to update and optimize your app for the foldable display of iPhone Duo. Discover how to opt in to the full-screen experience, adopt flexible layout best practices, and simulate poses in Device Hub with Xcode. Find out how to use size classes instead of interface orientation, handle asymmetric safe areas, and test Split View multitasking to ensure your app shines in all the ways people use it.
Chapters
- 0:00 - Introduction
- 0:30 - Build with the latest SDK
- 1:17 - Get started in Xcode
- 1:33 - Adopt flexible layouts
- 2:46 - Use size classes
- 3:57 - Avoid screen assumptions
- 5:01 - Adopt standard navigation
- 6:06 - Respect safe areas
- 8:08 - Use reserved regions
- 9:12 - Next steps
Resources
Related Videos
Meet with Apple
Tech Talks
- Leverage multiple displays and scenes on iPhone Duo
- Raise the bar with iPhone Duo
- Strike a pose with adaptive layouts on iPhone Duo
WWDC26
-
Search this video…
Hi, I'm David Jackson, an engineering manager on the UI Frameworks team. Today, I'll cover how to bring your app to iPhone Duo. First, I'll tell you how to get started in Xcode.
Next, I'll walk through general layout guidance to make your app resize correctly on any platform.
Then, I'll tell you about specific layout guidance for iPhone Duo to make your app truly shine.
Let's get started.
Your app will work on iPhone Duo even if you haven't built it with the iOS 27 SDK. When the device is closed, your app will use the screen space to the left of the status bar and camera. When the device is open, your app will be a familiar size and aspect ratio. Here's how to take more advantage of the available screen space. If you've already adopted the iOS 27 SDK, the work you've done to support iPhone app resizing really pays off. Now your app will look like this. Your app will extend to the left of the status bar area on the inner display.
And here's how to take advantage of the entire screen space. When you build your app with the iOS 27.1 SDK, your app extends to the edge of the screen. Standard navigation and toolbar buttons now lay out vertically under the status bar.
To get the full-screen experience, download Xcode 27.1. Choose the iPhone Duo simulator to run your app in Device Hub. Use the control buttons at the bottom of the screen to open, close, rotate, or fold iPhone Duo.
Now that your app is using the full screen space, you may notice some issues with your layout in each pose. A great iPhone Duo app follows flexible layout best practices we've discussed in the past. Most recently, we covered flexible layout principles during the talk, "Modernize Your UIKit App" from WWDC26. These principles matter more than ever for iPhone Duo, as your app will need to resize to fit every pose, opened, closed, rotated, or folded.
iPhone apps have been adapting to change for a long time. They've adapted to new screen sizes, screen shapes, and special regions like the Dynamic Island. iPhone Duo continues along that path with a new screen shape and camera location.
With iOS 27, people can resize your app larger than ever before using iPhone Mirroring on the Mac.
Opening and closing iPhone Duo works the same way. Your app may react to different size class boundaries, but it is still an iPhone app.
The best app layouts are adaptive across a continuum of devices. They avoid making assumptions about display sizes or device capabilities based on user interface idioms. And they use tools like size classes to differentiate between small and large layouts. Let's talk more about size classes.
Horizontal and vertical size classes are loosely tied to the available space in their given dimensions. Size classes express the user experience your app should provide based on the available space. For SwiftUI, use the environment. For UIKit, use trait collection.
On iPhone Duo, there are several size class combinations.
On the outer display, like other iPhone models, iPhone Duo has regular vertical size class and compact horizontal size class in portrait, and compact vertical and horizontal size classes in landscape.
On the inner display, the additional space lets you show more content like sidebars. As such, it has regular horizontal and vertical size classes. The interface orientation on the outer display behaves like any other iPhone. iPhone Duo is a great opportunity to support landscape orientation, as people may want to set the phone down like a tent.
Interface orientation on the inner display behaves differently. The inner display doesn't honor your supported interface orientations. As with Idiom, avoid checking interface orientation for layout decisions. Use size classes instead.
On a device with two displays, avoid referencing the main screen in your code. It's ambiguous and will be deprecated in a future release. If possible, don't use screen references at all. Instead, use more local concepts like the environment, trait collection, or the scene's bounds. If you need access to the screen, access it dynamically from the window scene.
To make sure your UI fits the corners of the screen perfectly, use Concentricity APIs introduced in iOS 26. They're updated to work with the screen shapes on iPhone Duo.
For SwiftUI, use ConcentricRectangle. For UIKit, use UICornerConfiguration.
iPhone Duo will continue to honor the UIRequiresFullScreen key, but your app will still resize when someone opens or closes their iPhone Duo.
iPhone Duo respects your supported interface orientations, but your app will scale on the inner display, including in Split View multitasking.
For more on iPhone Duo screens, see the companion Tech Talk, "Leverage multiple displays and scenes on iPhone Duo." Now that your app is resizing to fit the inner and outer displays, I'll talk about unique layout considerations for iPhone Duo.
Using standard navigation patterns is a great way to adapt to every iPhone Duo pose. SwiftUI's NavigationSplitView or UIKit's UISplitViewController are fully adaptive.
When iPhone Duo is closed, columns will collapse to single-stack navigation. When open, columns will appear both tiled and as overlays. SwiftUI's TabView and UIKit's UITabBarController also adapt to all poses.
By default, tabs will appear on the inner and outer display, laying out vertically when appropriate.
On the inner display, you can opt into a sidebar with richer navigation. For SwiftUI, set the default tab bar placement to sidebar. For UIKit, set the preferred placement to sidebar.
Sheets also adapt to all poses. On the outer display, sheets can have buttons that lay out vertically. On the inner display, sheets are centered. Other presentations like popovers, context menus, and alerts also adapt to each pose.
Navigation bars, toolbars, and tab bars lay out outside the safe area. They automatically avoid system UI like the status bar and hardware features like the camera.
Horizontal bars provide top and bottom insets, while vertical bars provide leading and trailing insets.
For a deep dive on vertically arranged content, check out the companion tech talk, "Raise the Bar with iPhone Duo".
Respecting safe areas ensures your app's controls are reachable and your app is fully visible. Here's how to best adopt safe areas in your app.
When positioning your UI, make sure to place foreground elements like interactive controls within the safe area. For SwiftUI, your content is placed within the safe area by default. For UIKit, if you are laying out views manually, reference the view's safe area insets, or use Auto Layout to constrain the views to the safe area layout guide.
Allow background elements such as full-bleed artwork to fill the available space, extending behind toolbars and sidebars.
For SwiftUI, use ignoresSafeArea. For UIKit, use the view's bounds.
Keep in mind that safe areas are often asymmetric. This is especially true on iPhone Duo. For example, vertical buttons can appear on the left side in landscape and Split View multitasking.
As such, avoid assuming that insets on opposite sides are equal.
Instead, write code that handles each side independently.
As with safe areas, layout margins are also asymmetric. This lets your foreground content get closer to vertical buttons and the status bar, while preserving the margin on the opposite side.
It's important to test your handling of safe areas in different configurations. Split View multitasking is no exception. Using Device Hub, preview your app on the inner display. Drag your app using the home indicator at the bottom to one side of the screen. An area to drop your app appears.
Then, drag your app to the other side.
Vertically laid-out content can appear on either side of your app.
Lastly, in iOS 27.1, we're introducing a new API that lets your custom UI use as much of the available screen space as possible without colliding with system-provided UI.
For SwiftUI, use ReservedRegion to safely position UI elements outside the safe area while maximizing usable space.
For UIKit, it's called UIViewReservedRegion.
This is a great option for building your own custom bars or when implementing edge-to-edge UI.
For more information on reserved regions, including how you can use them to build custom UI that adapts to the fold, see the companion Tech Talk, "Strike a Pose with Adaptive Layouts on iPhone Duo." To summarize safe area best practices, use standard bars for UI that automatically adapts to the safe area. Align your interactive or visible foreground content to the safe area, while background content may extend past the safe area. Make sure to account for, and test, asymmetrical safe areas and layout margins. If you have more complex layouts, consider using reserved regions.
I covered a lot of adaptive layout best practices. Here's an efficient way to make sure your app follows all of them.
During the talk, Modernize Your UIKit App, we introduced a new app modernization skill.
With Xcode 27.1, this skill has a new name: App Resizability. It now supports SwiftUI and iPhone Duo. Give it a try.
Now your app is ready to feel right at home on iPhone Duo.
To recap, download Xcode 27.1, simulate your app on iPhone Duo using Device Hub, make sure your app follows all the adaptive layout best practices I covered, and try out the App Resizability skill.
And that's it. Thank you so much for your time. I look forward to seeing your iPhone Duo app above the fold on the App Store.
-
-
2:59 - Read size classes
// SwiftUI @Environment(\.horizontalSizeClass) private var horizontalSizeClass @Environment(\.verticalSizeClass) private var verticalSizeClass // UIKit traitCollection.horizontalSizeClass traitCollection.verticalSizeClass -
4:16 - Access the screen from the window scene
// Avoid referencing the main screen on a two-display device. // Access the screen dynamically from the window scene instead. let screen = window?.windowScene?.screen -
4:30 - Match the screen corners with Concentricity
// SwiftUI ConcentricRectangle() .fill(Color.green) .padding(8.0) .ignoresSafeArea() // UIKit // UICornerConfiguration -
5:44 - Show a sidebar on the inner display
// SwiftUI TabView { … } .defaultTabBarPlacement(.sidebar) // UIKit tabBarController.sidebar.preferredPlacement = .sidebar -
6:52 - Align foreground content to the safe area
// UIKit foreground.frame = view.bounds.inset(by: view.safeAreaInsets) -
7:07 - Let background content extend past the safe area
// SwiftUI .ignoresSafeArea() // UIKit backgroundView.frame = view.bounds -
7:30 - Handle asymmetric safe area insets
// Avoid assuming insets on opposite sides are equal let width = view.bounds.width - view.safeAreaInsets.left * 2 // Handle each side independently let width = view.bounds.inset(by: view.safeAreaInsets).width -
9:25 - Replace main screen references
func updateThumbnail(from image: UIImage) { // Before let screenScale = UIScreen.main.scale // After let screenScale = traitCollection.displayScale // ... }
-
-
- 0:00 - Introduction
David Jackson from the UI Frameworks team outlines how to bring your app to iPhone Duo: getting started in Xcode, general resizing guidance, and layout guidance specific to iPhone Duo.
- 0:30 - Build with the latest SDK
Your app runs on iPhone Duo even without recompiling, but screen usage improves with each SDK. The iOS 27 SDK extends your app left of the status bar on the inner display; the iOS 27.1 SDK reaches the screen edge and lays standard navigation and toolbar buttons out vertically.
- 1:17 - Get started in Xcode
Download Xcode 27.1 and run your app in the iPhone Duo simulator using DeviceHub. On-screen control buttons let you open, close, rotate, and fold the device to check your layout in every pose.
- 1:33 - Adopt flexible layouts
iPhone Duo extends the long-standing need for adaptive layout — new screen shapes, camera locations, and iPhone mirroring on the Mac. Avoid assumptions about display size or capability based on user interface idiom, and design across a continuum of sizes.
- 2:46 - Use size classes
Size classes express the experience your app should provide for the available space — the environment in SwiftUI, trait collection in UIKit. The outer display behaves like other iPhone models, while the inner display is regular in both dimensions, leaving room for sidebars. The inner display doesn't honor supported interface orientations, so use size classes rather than orientation for layout decisions.
- 3:57 - Avoid screen assumptions
Don't reference the main screen on a two-display device — it's ambiguous and will be deprecated. Prefer the environment, trait collection, or the scene's bounds, and access screens dynamically from the window scene. Use the iOS 26 Concentricity APIs, ConcentricRectangle and UICornerConfiguration, to fit the screen's corners.
- 5:01 - Adopt standard navigation
NavigationSplitView, UISplitViewController, TabView, and UITabBarController are fully adaptive across every pose — columns collapse when closed and tile or overlay when open. On the inner display you can opt into a sidebar placement for richer navigation. Sheets, popovers, context menus, and alerts adapt as well.
- 6:06 - Respect safe areas
Standard bars lay out outside the safe area and automatically avoid the status bar and camera. Keep interactive foreground content inside the safe area, and let background artwork extend past it with ignoresSafeArea or the view's bounds. Safe areas and layout margins are often asymmetric on iPhone Duo, so handle each side independently and test in Split View.
- 8:08 - Use reserved regions
New in iOS 27.1, ReservedRegion in SwiftUI and UIViewReservedRegion in UIKit let custom UI claim as much screen space as possible without colliding with system UI — useful for custom bars and edge-to-edge designs.
- 9:12 - Next steps
The app modernization skill introduced in "Modernize your UIKit app" is now called App Resizability in Xcode 27.1, with support for SwiftUI and iPhone Duo. Download Xcode 27.1, simulate with DeviceHub, follow the adaptive layout practices, and try the skill.