Contents

withElements(_:)

Provides read-only access to the per-vertex data within a callback.

Declaration

func withElements<Result>(_ callback: (Span<ElementType>) -> Result) -> Result

Parameters

  • callback:

    A closure that receives a span over the per-vertex data.

Return Value

The value returned by callback.

Discussion

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

See Also

Accessing vertex data