Files
nexus/wiki/concepts/SwiftUI-Volumetric-APIs.md

30 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "SwiftUI Volumetric APIs"
type: concept
tags: []
sources: [visionos-spatial-engineer]
last_updated: 2026-04-25
---
## Definition
visionOS 26 新增的 SwiftUI API 集,专门用于在 volumetric 空间场景中渲染和管理 3D 内容,实现声明式的空间界面开发。
## Core Capabilities
- **3D Content Integration3D 内容集成)**:将 RealityKit 实体无缝嵌入 SwiftUI 视图层级
- **Volume ContentVolume 内容)**:支持在受限的 3D 空间volume内展示和管理内容
- **Breakthrough UI突破性 UI**:允许 UI 元素突破传统窗口边界,融入 3D 场景
- **Transient Content临时内容**:支持在 volume 内快速展示和消失的临时 UI 元素
## Key API Components
- **@Observable Entities**:声明式状态管理,与 SwiftUI 视图自动同步
- **Direct Gesture Handling**:在 3D 内容上直接处理手势输入
- **ViewAttachmentComponent**:将 SwiftUI 视图附加到 RealityKit 实体上
## Related Concepts
- [[RealityKit-SwiftUI Integration]]SwiftUI Volumetric APIs 的底层集成机制
- [[Spatial Layouts]]3D 内容在空间中的定位和布局模式
- [[Multi-Window Architecture]]Volumetric 内容在多窗口场景下的管理
## Sources
- [[visionos-spatial-engineer]] — visionOS Spatial Engineer Agent 角色定义