---
title: setContentsRectNeedsUpdate()
framework: visionkit
role: symbol
role_heading: Instance Method
path: visionkit/imageanalysisinteraction/setcontentsrectneedsupdate()
---

# setContentsRectNeedsUpdate()

Informs the view that contains the image when the layout changes and the view needs to reload its content.

## Declaration

```swift
@MainActor final func setContentsRectNeedsUpdate()
```

## Mentioned in

Enabling Live Text interactions with images

## Discussion

Discussion The framework ignores calls to this method when your app adds the interaction to a UIImageView, which calculates the contentsRect based on the image view’s UIView.ContentMode. When the view that contains the image isn’t an instance of UIImageView, call this method when the layout changes. The interaction then invokes the delegate’s contentsRect(for:) callback, which provides the updated content area to the system.

## See Also

### Managing custom image views

- [contentsRect](visionkit/imageanalysisinteraction/contentsrect.md)
