---
title: "withIntersections(_:)"
framework: realitykit
role: symbol
role_heading: Instance Method
path: "realitykit/clothqueryvolumeevents/newbodyintersections/withintersections(_:)"
---

# withIntersections(_:)

Provides access to the intersections with cloth bodies that took place.

## Declaration

```swift
func withIntersections<Result>(_ callback: (Span<ClothQueryVolumeEvents.NewBodyIntersections.Intersection>) -> Result) -> Result
```

## Parameters

- `callback`: A closure that receives a span over the intersections.

## Return Value

Return Value The value returned by callback.

## Discussion

Discussion This span is only available during the subscription callback of this event. The provided span is only valid for the lifetime of the callback.

## See Also

### Accessing the intersections

- [intersections](realitykit/clothqueryvolumeevents/newbodyintersections/intersections.md)
- [ClothQueryVolumeEvents.NewBodyIntersections.Intersection](realitykit/clothqueryvolumeevents/newbodyintersections/intersection.md)
