<!--
{
  "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/setLimits(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "DockKit"
    ],
    "preciseIdentifier" : "s:7DockKit0A9AccessoryC9setLimitsyyAC0E0VKF"
  },
  "title" : "setLimits(_:)"
}
-->

# setLimits(_:)

Sets limits for the axes of rotation.

```
final func setLimits(_ limits: DockAccessory.Limits) throws
```

## Parameters

`limits`

The upper and lower limit of orientation, in radians, for each of the supported axes.

## Discussion

Limits only apply to the current tracking session. Afterwards, the orientation specifications default to the manufacturer limits.
This method impacts primarily subsequent calls to [`setOrientation(_:duration:relative:)`](/documentation/DockKit/DockAccessory/setOrientation(_:duration:relative:)-2epe2) and [`setOrientation(_:duration:relative:)`](/documentation/DockKit/DockAccessory/setOrientation(_:duration:relative:)-6b0fl).
Limits only apply to the current tracking session. When the session ends, the orientation specifications default to the manufacturer limits.

This method only works when you disable system tracking.

> Throws: An error if all parameters are `nil`, or if the dock accessory doesn’t support the given axis.

---

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)