---
title: "track(_:cameraInformation:)"
framework: dockkit
role: symbol
role_heading: Instance Method
path: "dockkit/dockaccessory/track(_:camerainformation:)-4yl9b"
---

# track(_:cameraInformation:)

Automatically generate and send tracking vectors to the device.

## Declaration

```swift
final func track(_ metadata: [AVMetadataObject], cameraInformation: DockAccessory.CameraInformation) async throws
```

## Parameters

- `metadata`: An array of doc://com.apple.documentation/documentation/AVFoundation/AVMetadataObject objects indicating the location of objects within the frame.
- `cameraInformation`: The camera in current use and its orientation.

## Mentioned in

Track custom objects in a frame

## Discussion

Discussion The vectors are based on metadata coming from the camera. Disable system tracking, then supply the observations at a fixed rate between 10 and 30 times per second. Any other rate is unsupported. note: DockKitError.notSupported if called on macOS.

## See Also

### Selecting and tracking

- [selectSubject(at:)](dockkit/dockaccessory/selectsubject(at:).md)
- [track(_:cameraInformation:)](dockkit/dockaccessory/track(_:camerainformation:)-44mwn.md)
- [DockAccessory.Observation](dockkit/dockaccessory/observation.md)
- [DockAccessory.CameraInformation](dockkit/dockaccessory/camerainformation.md)
- [DockAccessory.CameraOrientation](dockkit/dockaccessory/cameraorientation.md)
