View in English

  • Apple 开发者
    • 入门汇总

    探索“入门汇总”

    • 概览
    • 学习
    • Apple Developer Program

    及时了解最新动态

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

    探索“平台”

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

    精选

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

    探索“技术”

    • 概览
    • Xcode
    • Swift
    • SwiftUI

    精选

    • 辅助功能
    • App Intents
    • Apple 智能
    • 游戏
    • 机器学习与 AI
    • 安全性
    • 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 帮助》
    • 即将实行的要求
    • 协议和准则
    • 系统状态
  • 快速链接

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

视频

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

更多视频

  • 简介
  • 概要
  • 代码
  • 升级改造你的 UIKit App

    探索 UIKit 的最新更新。了解如何更新 iPhone App 的布局,以便在调整大小时能够呈现出色效果,让你的 App 无论是通过 iPhone 镜像功能使用还是显示在 iPad 上都相宜。探索适用于标签栏和导航栏的全新 API,并了解如何针对 Apple 智能的新功能准备好的 App。我们还将介绍一种充分利用所选编码智能体的技巧,帮助你实现代码库现代化。

    章节

    • 0:00 - Introduction
    • 0:34 - App adaptivity
    • 2:10 - Legacy API: App lifecycle
    • 2:51 - Legacy API: Main screen
    • 5:46 - Full-screen mode for games
    • 6:17 - Legacy API: User interface idiom
    • 7:06 - Legacy API: Interface orientation
    • 7:55 - UIView Body protocols for motion & location
    • 8:19 - Test your resizable iPhone app
    • 9:18 - Tab bars and sidebars
    • 10:52 - Navigation bars
    • 12:37 - Menus
    • 13:01 - Integrate with Apple Intelligence
    • 14:07 - Agentic coding
    • 15:32 - Next steps

    资源

    • TN3208: Preparing your app’s launch screen to meet App Store requirements
    • TN3210: Optimizing your app for iPhone Mirroring
    • Make your UIKit app more flexible
    • Adapting your app when traits change
    • Transitioning to the UIKit scene-based life cycle
    • Automatic trait tracking
    • Human Interface Guidelines: Menus
      • 高清视频
      • 标清视频

    相关视频

    WWDC26

    • 充分利用 Device Hub
    • 探索适用于 Siri 和 Apple 智能的 App Intents 高级功能

    WWDC25

    • 让你的 UIKit App 更加灵活

    WWDC24

    • 提升 iPadOS 中的标签页和边栏使用体验
  • 搜索此视频…
    • 3:24 - Use local screen references

      // Use local screen references
      // Access the correct screen through a windowScene
      let screen = window?.windowScene?.screen
      
      // Pass in local screen references
      func generateThumbnail(_ image: UIImage, screen: UIScreen) -> UIImage {
          // existing code, replacing main screen with local screen reference
          // ...
      }
    • 3:49 - Replace screen scale with displayScale

      // Replace the screen's scale with trait collection's displayScale
      override func layoutSubviews() {
          super.layoutSubviews()
      
          // layoutSubviews will be called again automatically when displayScale changes
          let displayScale = traitCollection.displayScale
          // ...
      }
    • 4:36 - Register for trait changes

      // Manually register for trait changes
      let displayScaleTrait: [UITrait] = [UITraitDisplayScale.self]
      registerForTraitChanges(displayScaleTrait) {
          (view: GalleryView, previousTraitCollection: UITraitCollection) in
          view.cache.invalidate()
      }
    • 5:19 - Monitor effective geometry changes

      // UIWindowSceneDelegate
      func windowScene(
          _ windowScene: UIWindowScene,
          didUpdateEffectiveGeometry previousEffectiveGeometry: UIWindowScene.Geometry
      ) {
          let geometry = windowScene.effectiveGeometry
          let availableSpace = geometry.coordinateSpace.bounds
          // ...
      }
    • 5:35 - Check available space using view bounds

      // Checking available space
      override func viewDidLayoutSubviews() {
          super.viewDidLayoutSubviews()
      
          let availableSpace = view.bounds.size
          // ...
      }
    • 8:12 - Configure motion and location body

      // Configure motion and heading bodies
      override func viewDidLoad() {
          super.viewDidLoad()
      
          motionManager.deviceMotionBody = view
          locationManager.headingBody = view
      }
    • 9:51 - Opt into sidebar layout

      tabBarController.sidebar.preferredPlacement = .sidebar
    • 10:22 - Check sidebar availability

      tabBarController.sidebar.isAvailable
    • 10:53 - Set prominent tab identifier

      // Set the prominent tab
      let tabs = [
          // ...
      ]
      let tabBarController = UITabBarController(tabs: tabs)
      tabBarController.prominentTabIdentifier = "cart"
    • 11:30 - Customize bar minimization behavior

      // Customize bar minimization behavior
      override init(
          nibName nibNameOrNil: String?,
          bundle nibBundleOrNil: Bundle?
      ) {
          super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
      
          navigationItem.barMinimizationBehavior = .always
          navigationItem.barMinimizationSafeAreaAdjustment = .never
      }
    • 15:05 - Export Xcode skills for use in other tools

      xcrun agent skills export
    • 0:00 - Introduction
    • A modern UIKit app dynamically adjusts to the environment it runs in. iOS 27 introduces new requirements and APIs to help you get there. Discover new APIs in tab bars, navigation bars, and menus; Apple Intelligence support; and a new skill that helps an agent handle much of this modernization work automatically.

    • 0:34 - App adaptivity
    • iPhone apps are now fully resizable in iPhone Mirroring on Mac and when running on iPad. Your app needs to dynamically adjust to any available scene size at runtime. The four areas to audit are scene lifecycle adoption, main screen references, user interface idiom checks, and interface orientation checks.

    • 2:10 - Legacy API: App lifecycle
    • UIScene lifecycle is now required when building with the latest SDKs; apps without it will no longer launch. If you haven't migrated from app lifecycle yet, start here.

    • 2:51 - Legacy API: Main screen
    • UIScreen.main always refers to the device's main screen, but in resizable environments your scene may be running on a different screen entirely. Replace it with screen references from the window scene, trait collections for scale, and effective geometry for available space.

    • 5:46 - Full-screen mode for games
    • UIRequiresFullscreen is now honored on iPhone in resizable environments, enabling discrete resizing that respects your supported interface orientations so games always render at full quality.

    • 6:17 - Legacy API: User interface idiom
    • The user interface idiom trait is no longer meaningful for layout. An iPhone app running on iPad stays in the phone idiom but is fully resizable. Use size classes instead.

    • 7:06 - Legacy API: Interface orientation
    • Supported interface orientations are treated as a preference only and are ignored in resizable environments, including iPhone Mirroring which always reports portrait. Replace orientation checks with size classes.

    • 7:55 - UIView Body protocols for motion & location
    • UIView now conforms to the new Body protocols from CoreMotion and CoreLocation in iOS 27, making it straightforward to keep motion and location data in the correct coordinate space regardless of interface orientation.

    • 8:19 - Test your resizable iPhone app
    • Xcode 27's Device Hub app and Xcode Previews let you freely drag the edges of the simulator to test any screen size without needing multiple devices. Test with real devices for iPhone Mirroring and iPad.

    • 9:18 - Tab bars and sidebars
    • iPhone apps can now opt into a sidebar layout by setting tabBarController.sidebar.preferredPlacement to .sidebar, with the system deciding when there's enough space to show it. Check tabBarController.sidebar.isAvailable to determine if the system can show the sidebar, and use tabBarController.prominentTabIdentifier to pin any tab so it stays visible even when the tab bar collapses during scroll.

    • 10:52 - Navigation bars
    • Navigation bars can now slide away during scroll to give people more room. The system determines when this happens by default; override it with barMinimizationBehavior. The .automatic scroll edge effect style has new visuals; apps that previously overrode it to .soft should re-evaluate their design.

    • 12:37 - Menus
    • Menu element images may no longer appear by default in some contexts like menu bars on iPadOS and macOS. Use preferredImageVisibility to override this behavior where needed.

    • 13:01 - Integrate with Apple Intelligence
    • Menus automatically display an Ask Siri button when there's content relevant for Siri. If your app supports drag and drop, Siri can load resources from your drag handlers. Drag sessions can be initiated without a user gesture, so avoid triggering animations or presenting modal UI from sessionWillBegin.

    • 14:07 - Agentic coding
    • Xcode 27's app modernization skill can automatically convert mainScreen calls, replace orientation checks with size class checks, and migrate your app to scene lifecycle. Skills can also be exported for use in other tools.

    • 15:32 - Next steps
    • Build with the iOS 27 SDK, test in Device Hub and iPhone Mirroring on macOS 27, identify flexibility gaps in your app, and try the agentic modernization skill.

Developer Footer

  • 视频
  • WWDC26
  • 升级改造你的 UIKit App
  • 打开菜单 关闭菜单
    • iOS
    • iPadOS
    • macOS
    • Apple tvOS
    • visionOS
    • watchOS
    打开菜单 关闭菜单
    • Swift
    • SwiftUI
    • Swift Playground
    • TestFlight
    • Xcode
    • Xcode Cloud
    • SF Symbols
    打开菜单 关闭菜单
    • 辅助功能
    • 配件
    • Apple 智能
    • App 扩展
    • App Store
    • 音频与视频 (英文)
    • 增强现实
    • 设计
    • 分发
    • 教育
    • 字体 (英文)
    • 游戏
    • 健康与健身
    • App 内购买项目
    • 本地化
    • 地图与位置
    • 机器学习与 AI
    • 开源资源 (英文)
    • 安全性
    • 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 Academies (英文)
    • WWDC
    阅读最近新闻。
    获取 Apple Developer App。
    版权所有 © 2026 Apple Inc. 保留所有权利。
    使用条款 隐私政策 协议和准则