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).