<!--
{
  "availability" : [
    "visionOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ARKit",
  "identifier" : "/documentation/ARKit/CameraFrame/sample(for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "ARKit"
    ],
    "preciseIdentifier" : "s:5ARKit11CameraFrameV6sample3forAC6SampleVSgAA0bC8ProviderC0B8PositionO_tF"
  },
  "title" : "sample(for:)"
}
-->

# sample(for:)

Returns the camera frame sample for a given camera position.

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

## Parameters

`position`

The camera position to get the sample for.

## Return Value

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

---

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)