<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/ClothColliderEvents/NewBodyCollisions/withCollisions(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:22RealityFoundationCloth0C14ColliderEventsO17NewBodyCollisionsV04withH0yxxs4SpanVyAE9CollisionVGXElF"
  },
  "title" : "withCollisions(_:)"
}
-->

# withCollisions(_:)

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

```
func withCollisions<Result>(_ callback: (Span<ClothColliderEvents.NewBodyCollisions.Collision>) -> Result) -> Result
```

## Parameters

`callback`

A closure that receives a span over the collisions.

## Return Value

The value returned by `callback`.

## 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.

---

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)