<!--
{
  "availability" : [
    "macOS: 13.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "VisionKit",
  "identifier" : "/documentation/VisionKit/ImageAnalysisOverlayView/setContentsRectNeedsUpdate()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "VisionKit"
    ],
    "preciseIdentifier" : "s:9VisionKit24ImageAnalysisOverlayViewC26setContentsRectNeedsUpdateyyF"
  },
  "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 the superview is of type <doc://com.apple.documentation/documentation/AppKit/NSImageView>.

If the superview is a class other than `NSImageView`, call this method when the layout changes. The overlay view then invokes the delegate’s [`contentsRect(for:)`](/documentation/VisionKit/ImageAnalysisOverlayViewDelegate/contentsRect(for:)-34yzu) method to request the new content area.

---

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)