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 帮助》
    • 即将实行的要求
    • 协议和准则
    • 系统状态
  • 快速链接

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

视频

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

更多视频

  • 简介
  • 概要
  • SwiftUI 小组实验室

    参加我们的线上活动,与 Apple 工程师和设计师一起深入探索 WWDC26。在这个以 SwiftUI 为主题的活动中,你可以提出问题、获取建议,并实时关注围绕大会一周的相关重磅发布展开的精彩讨论。活动语言为英语。

    章节

    • 0:00:00 - Introduction
    • 0:02:58 - With 1M+ reorderable items, ForEach still traverses the whole collection on first display and every count/order change, causing slowdowns. Any plan for a fast native SwiftUI API?
    • 0:04:45 - In iOS 27 beta 1 it's not possible to create a custom transition — NavigationTransition is publicly empty. Will this come in a later beta?
    • 0:07:21 - With Coding Intelligence and agentic models in Xcode, how can we use it to build Liquid Glass views? Sometimes .glassEffect on buttons doesn't look as polished as it should.
    • 0:14:06 - What's the best way to manage screen sizes now — vertical, horizontal, split views, and the unlimited window sizes we can have? What API should we use across iOS versions?
    • 0:22:00 - Any tips for properly learning data management and passing data between views? What projects help strengthen this?
    • 0:30:38 - I've heard I shouldn't use an if {} to conditionally hide elements (e.g. show text only at 9:41). What's Apple's recommendation?
    • 0:38:13 - What's the concrete cost of type erasure (AnyView) in a deeply nested or frequently updating view — when should I worry, and when not?
    • 0:39:30 - Any tips for making SwiftUI layouts more adaptable now that Xcode previews are resizable?
    • 0:42:29 - What's your advice for presenting full-screen SwiftUI overlays on top of everything (including sheets) without interfering with modal presentation?
    • 0:47:40 - What's the best way to build a pure-SwiftUI custom control (like a dropdown) that expands on top of other elements and is interactive, without impacting their layout?
    • 0:54:45 - It's known that breaking large SwiftUI views into smaller views benefits performance, but how small should they be? Best practice for struct views vs. @ViewBuilder computed properties?

    资源

      • 高清视频
      • 标清视频
  • 搜索此视频…
    • 0:00:00 - Introduction
    • Engineers from the SwiftUI team introduce themselves and set up a session covering large collections and ForEach performance, navigation transitions, adaptive layout across screen sizes, data flow, conditional views, AnyView cost, custom controls and overlays, and building views with Liquid Glass.

    • 0:02:58 - With 1M+ reorderable items, ForEach still traverses the whole collection on first display and every count/order change, causing slowdowns. Any plan for a fast native SwiftUI API?
    • The team is aware of this and looking into it — traversing the entire collection on updates shouldn't be necessary, and they acknowledged it as a real limitation for very large reorderable collections. File a Feedback with your use case; for now, extremely large datasets may still need careful structuring to avoid full-collection traversal on every change.

    • 0:04:45 - In iOS 27 beta 1 it's not possible to create a custom transition — NavigationTransition is publicly empty. Will this come in a later beta?
    • NavigationTransition is a protocol SwiftUI uses to expose conforming, framework-provided transitions rather than one you fill in yourself in beta 1. Use the built-in transitions the API vends; if you need a specific custom transition, file Feedback describing it, since the surface may expand in later betas.

    • 0:07:21 - With Coding Intelligence and agentic models in Xcode, how can we use it to build Liquid Glass views? Sometimes .glassEffect on buttons doesn't look as polished as it should.
    • The new skills shipping with Xcode give the coding agent accurate insight into current APIs like Liquid Glass and work with the model of your choice, so they're worth enabling — and you can export them for use in other agentic systems. On glass itself: avoid Liquid Glass in the content area of a view, since with nothing scrolling underneath there's nothing for it to refract and the simpler flat design is usually better; glass is for controls hugging the content layer. For a glass button, reach for the glassButtonStyle (or glassProminent) rather than applying a raw glassEffect — glassEffect on a button gives you a button sitting on glass, which won't look right — and pair it with buttonBorderShape to get the shape you want. Toolbar and navigation-bar buttons already get the right glass treatment automatically, so you don't need to add it there; new this year, sharedBackgroundVisibility(.hidden) and a content-margin-removal API let you drop the glass (or just its padding) for cases like a profile photo in the toolbar.

    • 0:14:06 - What's the best way to manage screen sizes now — vertical, horizontal, split views, and the unlimited window sizes we can have? What API should we use across iOS versions?
    • Don't hard-code specific window sizes — that's a losing battle. Design layouts that work at any size and adapt fluidly. Use size classes (compact vs. regular, vertically/horizontally) to make layout decisions, and lean on adaptive containers so your UI responds to the full continuum of window and screen sizes rather than targeting fixed dimensions.

    • 0:22:00 - Any tips for properly learning data management and passing data between views? What projects help strengthen this?
    • At its core, SwiftUI data management is about identifying pieces of information and choosing where they should live and how they flow. Learn the tools — @State for view-owned state, bindings to share mutable access, and @Observable/Environment for passing data down — by building small apps that force you to move data between screens, rather than studying the wrappers in isolation.

    • 0:30:38 - I've heard I shouldn't use an if {} to conditionally hide elements (e.g. show text only at 9:41). What's Apple's recommendation?
    • An if that swaps views changes the view's identity and structure, which can cost more than necessary for simple show/hide. Prefer keeping the element in the hierarchy and controlling its visibility — for example with opacity or the hidden modifier, or conditional content that preserves identity — so SwiftUI can animate and update efficiently instead of inserting/removing the view.

    • 0:38:13 - What's the concrete cost of type erasure (AnyView) in a deeply nested or frequently updating view — when should I worry, and when not?
    • AnyView erases the type SwiftUI would otherwise use to diff efficiently, so it adds overhead and reduces the framework's ability to optimize updates — most impactful in deeply nested or frequently updating views. It's fine where you genuinely can't know the view type at compile time; just avoid it on hot paths where a concrete type or @ViewBuilder would let SwiftUI update more efficiently.

    • 0:39:30 - Any tips for making SwiftUI layouts more adaptable now that Xcode previews are resizable?
    • Use the resizable previews to exercise your layout across sizes as you build. Design for flexibility — avoid fixed frames, use size classes and adaptive containers, and let content drive layout — so your UI holds up across the full range of window sizes the resizable preview now lets you check quickly.

    • 0:42:29 - What's your advice for presenting full-screen SwiftUI overlays on top of everything (including sheets) without interfering with modal presentation?
    • There may be no clean way to do this purely in SwiftUI today. A full-screen cover works when you present it from the right point in the hierarchy, but getting something reliably above other modal presentations is genuinely hard. The pragmatic approach is interop: drop down to UIKit and create a new UIWindow (with a UIHostingController root) for a HUD or a login-over-the-app case, positioning it above everything. But be careful — with multiple windows it's last-UIWindow-wins, which is a bug waiting to happen once something else also needs to be always on top. So question the design brief first: a less disruptive flow (for example rewinding the navigation stack to a base view and restoring it after login) is often better than forcing a global overlay. File feedback with your use case so the gaps can be closed.

    • 0:47:40 - What's the best way to build a pure-SwiftUI custom control (like a dropdown) that expands on top of other elements and is interactive, without impacting their layout?
    • First ask whether it needs to be fully custom — an existing UIKit/AppKit control may already do it. If custom, present the expanding portion as an overlay so it draws above sibling views without participating in their layout, and manage its own interaction/state, rather than inserting it inline where it would push other elements around.

    • 0:54:45 - It's known that breaking large SwiftUI views into smaller views benefits performance, but how small should they be? Best practice for struct views vs. @ViewBuilder computed properties?
    • Size isn't the real goal — isolating independently-updating data is. Split a view when its parts update from different data (e.g. a header, content, and footer that each change on their own), so a change to one doesn't invalidate and re-run the body of the whole. If the dependencies are shared across the whole view, splitting buys you nothing — you do the same work either way. Crucially, extracting into a @ViewBuilder computed property gives no performance benefit, because it's still one view body with all the same dependencies; only a separate view type creates an initialization boundary where SwiftUI can compare inputs and skip work. An @Observable reference helps here too, since its stable pointer lets a small subview redraw without re-running the parent. And don't be afraid of many small views — they're value-type structs and cheap.

开发者页脚

  • 视频
  • WWDC26
  • SwiftUI 小组实验室
  • 打开菜单 关闭菜单
    • 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。
    版权所有 © 2026 Apple Inc. 保留所有权利。
    使用条款 隐私政策 协议和准则