<!--
{
  "availability" : [
    "macOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CompositorServices",
  "identifier" : "/documentation/CompositorServices/LayerRenderer/onSpatialEvent-2jg60",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Compositor Services",
      "SwiftUI",
      "CompositorServices"
    ],
    "preciseIdentifier" : "s:So27CP_OBJECT_cp_layer_rendererC27_CompositorServices_SwiftUIE14onSpatialEventyy0hI00kL10CollectionVScMYccvp"
  },
  "title" : "onSpatialEvent"
}
-->

# onSpatialEvent

A closure that receives the spatial events updates from the LayerRenderer

```
@MainActor var onSpatialEvent: @MainActor (SpatialEventCollection) -> Void { get set }
```

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)