swiftui scroll view coordinate space

Asked on 2025-07-14

1 search

In the context of SwiftUI and coordinate spaces, there are several relevant points discussed in the WWDC sessions:

  1. Coordinate Spaces in SwiftUI: SwiftUI provides local and global coordinate spaces. The local coordinate space refers to the current view's coordinate space with the origin at the top left of the view, while the global coordinate space refers to the window's coordinate space with the origin at the top left of the window.

  2. Immersive Coordinate Space: Introduced in VisionOS 1.1, the immersive coordinate space is a new type of coordinate space that fits alongside SwiftUI's existing local and global coordinate spaces. It has its origin defined as the point on the ground below you, which is particularly useful for spatial and immersive applications. This is discussed in the session Dive deep into volumes and immersive spaces (19:38).

  3. Coordinate Conversion: SwiftUI and RealityKit have enhanced capabilities for coordinate conversion, allowing for seamless transitions between different coordinate spaces. This is particularly useful when working with 3D content and immersive experiences. The session Better together: SwiftUI and RealityKit (24:56) covers unified coordinate conversion.

These sessions provide insights into how SwiftUI handles coordinate spaces, especially in the context of immersive and 3D applications. If you are interested in more details about scroll views and coordinate spaces, the session What’s new in SwiftUI (16:18) discusses scrolling enhancements in SwiftUI.