---
title: "animate(motion:)"
framework: dockkit
role: symbol
role_heading: Instance Method
path: "dockkit/dockaccessory/animate(motion:)"
---

# animate(motion:)

Starts an animation sequence.

## Declaration

```swift
final func animate(motion: DockAccessory.Animation) async throws -> Progress
```

## Parameters

- `motion`: The animation sequence to perform.

## Return Value

Return Value A progress object that reports the progress during execution of the animation sequence.

## Discussion

Discussion This method moves the dock accessory along a predefined trajectory to convey a characteristic. Do this only if you disable system tracking. note: DockKitError.notConnected if device isn’t connected, DockKitError.frameRateTooHigh if calling the method too frequently, or DockKitError.notSupported in macOS.

## See Also

### Performing animation

- [setRegionOfInterest(_:)](dockkit/dockaccessory/setregionofinterest(_:).md)
- [regionOfInterest](dockkit/dockaccessory/regionofinterest.md)
- [DockAccessory.Animation](dockkit/dockaccessory/animation.md)
