---
title: "setLimits(_:)"
framework: dockkit
role: symbol
role_heading: Instance Method
path: "dockkit/dockaccessory/setlimits(_:)"
---

# setLimits(_:)

Sets limits for the axes of rotation.

## Declaration

```swift
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

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:) and setOrientation(_:duration:relative:). 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. note: An error if all parameters are nil, or if the dock accessory doesn’t support the given axis.

## See Also

### Setting position and limits

- [setOrientation(_:duration:relative:)](dockkit/dockaccessory/setorientation(_:duration:relative:)-2epe2.md)
- [setOrientation(_:duration:relative:)](dockkit/dockaccessory/setorientation(_:duration:relative:)-6b0fl.md)
- [setAngularVelocity(_:)](dockkit/dockaccessory/setangularvelocity(_:).md)
