---
title: "predictAnchor(for:at:)"
framework: arkit
role: symbol
role_heading: Instance Method
path: "arkit/accessorytrackingprovider/predictanchor(for:at:)"
---

# predictAnchor(for:at:)

Predict an accessory anchor to a target timestamp.

## Declaration

```swift
final func predictAnchor(for anchor: AccessoryAnchor, at timestamp: TimeInterval) -> AccessoryAnchor?
```

## Parameters

- `anchor`: A tracked anchor from latestAnchors to generate prediction for.
- `timestamp`: Target time for prediction. For rendering use cases with CompositorServices, use drawable.frameTiming.trackableAnchorPredictionTime.

## Return Value

Return Value The predicted anchor, or nil if prediction failed.

## Discussion

Discussion note: A large time offset from latest anchor timestamp could degrade accuracy. For accuracy sensitive use cases like drawing, use a small offset or latestAnchors. Use a prediction timestamp smaller than the latest anchor timestamp for interpolation.
