<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 17.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "VisionKit",
  "identifier" : "/documentation/VisionKit/ImageAnalysisInteraction/setContentsRectNeedsUpdate()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "VisionKit"
    ],
    "preciseIdentifier" : "s:9VisionKit24ImageAnalysisInteractionC26setContentsRectNeedsUpdateyyF"
  },
  "title" : "setContentsRectNeedsUpdate()"
}
-->

# setContentsRectNeedsUpdate()

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

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

## Discussion

The framework ignores calls to this method when your app adds the interaction to a <doc://com.apple.documentation/documentation/UIKit/UIImageView>,
which calculates the [`contentsRect`](/documentation/VisionKit/ImageAnalysisInteraction/contentsRect) based on the image view’s <doc://com.apple.documentation/documentation/UIKit/UIView/ContentMode-swift.enum>.

When the view that contains the image isn’t an instance of
<doc://com.apple.documentation/documentation/UIKit/UIImageView>, call this method when the layout changes. The interaction then invokes the delegate’s
[`contentsRect(for:)`](/documentation/VisionKit/ImageAnalysisInteractionDelegate/contentsRect(for:)) callback, which provides the updated content area to the system.

---

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)