<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "macOS: 14.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "DockKit",
  "identifier" : "/documentation/DockKit/DockAccessory/animate(motion:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "DockKit"
    ],
    "preciseIdentifier" : "s:7DockKit0A9AccessoryC7animate6motionSo10NSProgressCAC9AnimationO_tYaKF"
  },
  "title" : "animate(motion:)"
}
-->

# animate(motion:)

Starts an animation sequence.

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

## Parameters

`motion`

The animation sequence to perform.

## Return Value

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

## Discussion

This method moves the dock accessory along a predefined trajectory to convey a characteristic. Do this only if you disable system tracking.

> Throws: ``doc://com.apple.DockKit/documentation/DockKit/DockKitError/notConnected`` if device isn’t connected, ``doc://com.apple.DockKit/documentation/DockKit/DockKitError/frameRateTooHigh`` if calling the method too frequently, or ``doc://com.apple.DockKit/documentation/DockKit/DockKitError/notSupported`` in macOS.

---

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)