invalidatableContent

Mark the receiver as their content might be invalidated.

View ModifieriOS 17.0+macOS 14.0+tvOS 17.0+watchOS 10.0+invalidatableContent(_:) in SwiftUI

Declaration

React
compose().invalidatableContent(invalidatable?: boolean)
Swift
nonisolated func invalidatableContent(
    _ invalidatable: Bool = true
) -> some View

Parameters

  • invalidatableboolean

    Whether the receiver content might be invalidated.

Discussion

Use this modifier to annotate views that display values that are derived from the current state of your data and might be invalidated in response of, for example, user interaction.

The view will change its appearance when RedactionReasons.invalidated is present in the environment.

In an interactive widget a view is invalidated from the moment the user interacts with a control on the widget to the moment when a new timeline update has been presented.

See also

More in Input and interaction.