---
title: onSpatialEvent
framework: compositorservices
role: symbol
role_heading: Instance Property
path: compositorservices/layerrenderer/onspatialevent-2jg60
---

# onSpatialEvent

A closure that receives the spatial events updates from the LayerRenderer

## Declaration

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