Contents

setContentsRectNeedsUpdate()

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

Declaration

@MainActor final func setContentsRectNeedsUpdate()

Mentioned in

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