---
title: "withPositions(_:)"
framework: realitykit
role: symbol
role_heading: Instance Method
path: "realitykit/clothposeresource/withpositions(_:)"
---

# withPositions(_:)

Provides access to the positions of all the vertices within a callback.

## Declaration

```swift
final func withPositions<Result>(_ callback: (Span<SIMD3<Float>>) -> Result) -> Result
```

## Parameters

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

## Return Value

Return Value The value returned by callback.

## Discussion

Discussion The provided span is only valid for the lifetime of the callback.

## See Also

### Accessing pose positions

- [positions](realitykit/clothposeresource/positions.md)
- [position(at:)](realitykit/clothposeresource/position(at:).md)
- [vertexCount](realitykit/clothposeresource/vertexcount.md)
