iOS 27 的 SwiftUI 有哪些更新
Asked on 2026-07-15
1 search
如果你说的是 WWDC 2024 之后到 WWDC 2026 里 SwiftUI 的更新,从你给的内容里可以看出,SwiftUI 主要有这些新变化:
交互能力
- 可重排容器(reorderable containers):可以很容易地在任意容器里做拖拽排序,不再局限于
List。 - 任意容器中的 swipe actions:现在
swipeActions不只限于列表,也能用于其他容器中的行。 - 更灵活的文本选择:iOS 上文本选择能力更接近
TextField/TextEditor的完整体验;macOS 还支持自定义文本渲染、文字生辉效果和竖排文本。
性能提升
- SwiftUI / AppKit / UIKit 更共享底层架构,因此很多控件能同时受益。
- 布局更快:在某些嵌套栈布局中,布局计算会更少,resize 速度最高可快两倍。
- State Objects 更智能:
@StateObject只在首次加载时初始化,避免重复创建临时实例。 AsyncImage自动缓存:会自动缓存内容,减少重复加载。- 列表与滚动性能继续增强:更大列表更新更快,滚动也更流畅。
新能力与 API
- Web 内容支持增强:有更完整的 SwiftUI Web APIs,例如更原生的 WebView / Web Page 相关能力。
- 富文本编辑:
TextEditor可以通过AttributedString进行富文本编辑,并支持选区跟踪和格式化工具。 - 3D 图表:
Swift Charts支持 3D,并且能和 Vision Pro 的空间环境配合。 - 空间 / 体积布局:SwiftUI 在 visionOS 上获得更多 3D 布局和空间对齐能力,例如
Spatial Container、3D anchor preferences 等。 - 文档 API 改进:支持按需读写文件片段、观察和更新文档属性,并更好地结合 Observation 和 Swift Concurrency。
设计与组件更新
- 新设计系统:在 WWDC 2025 中,SwiftUI 的导航、Tab、工具栏、搜索、控件等都围绕新设计进行了更新。
- Liquid Glass:工具栏、侧边栏、Tab Bar 等出现新的玻璃质感与过渡效果。
- 更多平台一致性:SwiftUI 在 iPad、macOS、visionOS、CarPlay 等平台上的能力继续扩展。
互操作性
- SwiftUI 与 AppKit / UIKit 更深入融合
- 手势认知能力可以在 SwiftUI 中更好地使用 UIKit 手势识别器。
- 动画也更容易跨 UIKit / AppKit 和 SwiftUI 驱动。
- 你也可以在 AppKit / UIKit 应用中更自然地采用 SwiftUI。
如果你愿意,我也可以按 WWDC 2025 或 WWDC 2026 分开,整理成一份更具体的“iOS 27 相关 SwiftUI 更新清单”。

Platforms State of the Union
Discover the newest advancements on Apple platforms.

Platforms State of the Union
Discover the newest advancements on Apple platforms.

Use SwiftUI with AppKit and UIKit
Discover how to incrementally adopt SwiftUI in your existing AppKit or UIKit app. We’ll show you how to use the Observation framework to automatically update your views, integrate SwiftUI components into an existing view hierarchy, and bring gesture recognizers into SwiftUI. We’ll also explore how to add complete SwiftUI scenes to your app without changing your overall architecture.
