View in English

  • Apple 开发者
    • 入门汇总

    探索“入门汇总”

    • 概览
    • 学习
    • Apple Developer Program

    及时了解最新动态

    • 最新动态
    • 开发者你好
    • 平台

    探索“平台”

    • Apple 平台
    • iOS
    • iPadOS
    • macOS
    • Apple tvOS
    • visionOS
    • watchOS
    • App Store

    精选

    • 设计
    • 分发
    • 游戏
    • 配件
    • 网页
    • Home
    • CarPlay 车载
    • 技术

    探索“技术”

    • 概览
    • Xcode
    • Swift
    • SwiftUI

    精选

    • 辅助功能
    • AI 与机器学习
    • App Intents
    • Apple 智能
    • 游戏
    • 安全性
    • Xcode Cloud
    • 社区

    探索“社区”

    • 概览
    • “与 Apple 会面交流”活动
    • 社区活动
    • 开发者论坛
    • 开源

    精选

    • WWDC
    • Swift Student Challenge
    • 开发者故事
    • App Store 大奖
    • Apple 设计大奖
    • Apple Developer Centers
    • 文档

    探索“文档”

    • 文档库
    • 技术概述
    • 示例代码
    • 《人机界面指南》
    • 视频

    发布说明

    • 精选更新
    • iOS
    • iPadOS
    • macOS
    • watchOS
    • visionOS
    • Apple tvOS
    • Xcode
    • 下载

    探索“下载”

    • 所有下载
    • 操作系统
    • 应用程序
    • 设计资源

    精选

    • Xcode
    • TestFlight
    • 字体
    • SF Symbols
    • Icon Composer
    • 支持

    探索“支持”

    • 概览
    • 帮助指南
    • 开发者论坛
    • “反馈助理”
    • 联系我们

    精选

    • 《开发者账户帮助》
    • 《App 审核指南》
    • 《App Store Connect 帮助》
    • 即将实行的要求
    • 协议和准则
    • 系统状态
  • 快速链接

    • 活动
    • 新闻
    • 论坛
    • 示例代码
    • 视频
 

视频

打开菜单 关闭菜单
  • 专题
  • 所有视频
  • 关于

更多视频

  • 简介
  • 概要
  • 代码
  • 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.

    章节

    • 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

    资源

      • 高清视频
      • 标清视频

    相关视频

    WWDC26

    • 升级改造你的 UIKit App

    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
  • 搜索此视频…
    • 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.

开发者页脚

  • 视频
  • Tech Talks
  • Prepare your app for iPhone Duo
  • 打开菜单 关闭菜单
    • iOS
    • iPadOS
    • macOS
    • Apple tvOS
    • visionOS
    • watchOS
    • App Store
    打开菜单 关闭菜单
    • Swift
    • SwiftUI
    • Swift Playground
    • TestFlight
    • Xcode
    • Xcode Cloud
    • Icon Composer
    • SF Symbols
    打开菜单 关闭菜单
    • 辅助功能
    • 配件
    • AI 与机器学习
    • Apple 智能
    • 音频与视频
    • 增强现实
    • 商务
    • 设计
    • 分发
    • 教育
    • 游戏
    • 健康与健身
    • App 内购买项目
    • 本地化
    • 地图与位置
    • 安全性
    • Safari 浏览器与网页
    打开菜单 关闭菜单
    • 文档
    • 下载
    • 示例代码
    • 视频
    • 文档归档
    打开菜单 关闭菜单
    • 帮助指南与文章
    • 联系我们
    • 论坛
    • 反馈与错误报告
    • 系统状态
    打开菜单 关闭菜单
    • Apple 开发者
    • App Store Connect
    • 证书、标识符和描述文件
    • “反馈助理”
    打开菜单 关闭菜单
    • Apple Developer Program
    • Apple Developer Enterprise Program
    • App Store Small Business Program
    • MFi Program
    • Mini Apps Partner Program
    • News Partner Program
    • Video Partner Program
    • 安全赏金计划
    • Security Research Device Program
    打开菜单 关闭菜单
    • 与 Apple 会面交流
    • Apple Developer Center
    • App Store 大奖
    • Apple 设计大奖
    • Apple Developer Academy
    • WWDC
    阅读最近新闻。
    获取 Apple Developer App,并在 bilibili 和微信上关注我们。
    版权所有 © 2026 Apple Inc. 保留所有权利。
    使用条款 隐私政策 协议和准则