What is a containerrelativeframe
Asked on 07/30/2024
1 search
A containerRelativeFrame
is a concept introduced in VisionOS 1.1, specifically within the context of immersive spaces. It is a named coordinate space that allows for precise specification of positions relative to a particular frame of reference. This new immersive coordinate space fits alongside SwiftUI's existing local and global coordinate spaces.
- Local Coordinate Space: Refers to the current view's coordinate space with the origin at the top left of the view.
- Global Coordinate Space: Refers to the window's coordinate space with the origin at the top left of the window.
- Immersive Coordinate Space: Sits above the global coordinate space and has its origin defined as the point on the ground below you.
This immersive space is particularly useful for building transitions to immersive spaces using RealityView, which provides functions to convert between RealityKit and SwiftUI coordinate spaces.
For more details, you can refer to the session Dive deep into volumes and immersive spaces (19:38).

Work with windows in SwiftUI
Learn how to create great single and multi-window apps in visionOS, macOS, and iPadOS. Discover tools that let you programmatically open and close windows, adjust position and size, and even replace one window with another. We’ll also explore design principles for windows that help people use your app within their workflows.

Build immersive web experiences with WebXR
Discover how WebXR empowers you to add fully immersive experiences to your website in visionOS. Find out how to build WebXR experiences that take full advantage of the input capabilities of visionOS, and learn how you can use Simulator to test WebXR experiences on macOS.

Render Metal with passthrough in visionOS
Get ready to extend your Metal experiences for visionOS. Learn best practices for integrating your rendered content with people’s physical environments with passthrough. Find out how to position rendered content to match the physical world, reduce latency with trackable anchor prediction, and more.