---
title: "sample(for:)"
framework: arkit
role: symbol
role_heading: Instance Method
path: "arkit/cameraframe/sample(for:)"
---

# sample(for:)

Returns the camera frame sample for a given camera position.

## Declaration

```swift
func sample(for position: CameraFrameProvider.CameraPosition) -> CameraFrame.Sample?
```

## Parameters

- `position`: The camera position to get the sample for.

## Return Value

Return Value The camera frame sample, or nil if no sample is available for the given camera position.

## See Also

### Getting camera frame information

- [primarySample](arkit/cameraframe/primarysample.md)
- [CameraFrame.Sample](arkit/cameraframe/sample.md)
- [description](arkit/cameraframe/description.md)
