---
title: SpatialEventCollection
framework: swiftui
role: symbol
role_heading: Structure
path: swiftui/spatialeventcollection
---

# SpatialEventCollection

A collection of spatial input events that target a specific view.

## Declaration

```swift
struct SpatialEventCollection
```

## Overview

Overview You receive a structure of this type as an input to the onChanged(_:) or onEnded(_:) method of a SpatialEventGesture. The structure contains a collection of SpatialEventCollection.Event values that correspond to ongoing input events. You can look up a specific event in the collection by its id value or iterate over all events in the collection to apply logic depending on the event’s state.

## Topics

### Accessing the collection’s events

- [SpatialEventCollection.Event](swiftui/spatialeventcollection/event.md)
- [subscript(_:)](swiftui/spatialeventcollection/subscript(_:).md)

### Iterating over events in the collection

- [makeIterator()](swiftui/spatialeventcollection/makeiterator().md)
- [SpatialEventCollection.Iterator](swiftui/spatialeventcollection/iterator.md)

## Relationships

### Conforms To

- [Collection](swift/collection.md)
- [Equatable](swift/equatable.md)
- [Sequence](swift/sequence.md)

## See Also

### Recognizing spatial events

- [SpatialEventGesture](swiftui/spatialeventgesture.md)
- [Chirality](swiftui/chirality.md)
