---
title: "contentsRect(for:)"
framework: visionkit
role: symbol
role_heading: Instance Method
path: "visionkit/imageanalysisoverlayviewdelegate/contentsrect(for:)"
---

# contentsRect(for:)

Returns the rectangle, in unit coordinate space, that contains the image within the view.

## Declaration

```swift
@MainActor func contentsRect(for overlayView: ImageAnalysisOverlayView) -> CGRect
```

## Parameters

- `overlayView`: The associated overlay view for the contents rectangle.

## Return Value

Return Value The rectangle of the image within the view, in unit coordinates. The default return value is the unit rectangle [0.0, 0.0, 1.0, 1.0], which represents the whole view contents.

## Discussion

Discussion Implement this method if the trackingImageView type isn’t NSImageView.

## See Also

### Providing interface details

- [contentView(for:)](visionkit/imageanalysisoverlayviewdelegate/contentview(for:).md)
