---
title: immersiveSpace
framework: swiftui
role: symbol
role_heading: Type Property
path: swiftui/coordinatespaceprotocol/immersivespace
---

# immersiveSpace

The named coordinate space that represents the currently opened ImmersiveSpace scene. If no immersive space is currently opened, this CoordinateSpace provides the same behavior as the .global coordinate space.

## Declaration

```swift
static var immersiveSpace: NamedCoordinateSpace { get }
```

## Discussion

Discussion Use this to convert transforms from a window to an immersive space. The following sample converts the top-leading-back origin of a Model3D view to coordinates in the immersive space. Model3D(url: URL(string: "https://example.com/robot.usdz")!)     .onGeometryChange3D(for: AffineTransform3D.self) { proxy in         // Convert the view's transform to the immersive space         return proxy.transform(in: .immersiveSpace) ?? .identity     } action: { transform in         appModel.immersiveSpaceFromCuboid = transform     } } Then, apply it to a corresponding Model3D in the immersive space. if let transform = appModel.immersiveSpaceFromRobot {     Model3D(url: URL(string: "https://example.com/robot.usdz")!)         // Align the origin of this Model3D to its top-leading-back         .visualEffect3D({ effect, proxy in             effect                 .offset(x: proxy.size.width/2, y: proxy.size.height/2)                 .offset(z: proxy.size.depth/2)         })         // Apply the transform in SRT order        .scaleEffect(transform.scale)        .rotation3DEffect(transform.rotation ?? .identity)        .transform3DEffect(AffineTransform3D(            translation: transform.translation)) } To apply scale and rotation relative to a view’s origin, don’t set them at the same time using transform3DEffect(_:). Instead, set them separately using scaleEffect(_:anchor:) together with rotation3DEffect(_:anchor:). note: See WWDC24 session 10153: Dive deep into volumes and immersive spaces for details on how to convert between coordinate spaces with SwiftUI and RealityKit.

## See Also

### Getting built-in coordinate spaces

- [global](swiftui/coordinatespaceprotocol/global.md)
- [local](swiftui/coordinatespaceprotocol/local.md)
- [named(_:)](swiftui/coordinatespaceprotocol/named(_:).md)
- [scrollView](swiftui/coordinatespaceprotocol/scrollview.md)
- [scrollView(axis:)](swiftui/coordinatespaceprotocol/scrollview(axis:).md)
