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

# setRegionOfInterest(_:)

Sets the area in the video frame in which the dock accessory tracks a subject.

## Declaration

```swift
final func setRegionOfInterest(_ region: CGRect) async throws
```

## Parameters

- `region`: The area in the video frame in which the dock accessory tracks a subject.

## Discussion

Discussion The region of interest is an limited area within the video frame that DockKit tracks a subject in. The default value is (0,0,1,1), which indicates that the whole frame is of interest. If you disable system tracking, this configuration change applies to any custom tracking for this dock accessory. The configuration applies to any camera stream the app has open if system tracking is enabled. The region of interest doesn’t persist; it resets to the entire video frame any time an app exits, backgrounds, or stops tracking. note: DockKitError.notConnected if device isn’t connected, or DockKitError.notSupported if called on macOS.

## See Also

### Performing animation

- [animate(motion:)](dockkit/dockaccessory/animate(motion:).md)
- [regionOfInterest](dockkit/dockaccessory/regionofinterest.md)
- [DockAccessory.Animation](dockkit/dockaccessory/animation.md)
