<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: -",
    "swift: 5.1.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIView/Invalidating",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "s:So6UIViewC5UIKitE12InvalidatingV"
  },
  "title" : "UIView.Invalidating"
}
-->

# UIView.Invalidating

A property wrapper that notifies the system that a property value change has invalidated an aspect of the containing view.

```
@propertyWrapper struct Invalidating<Value, InvalidationType> where Value : Equatable, InvalidationType : UIViewInvalidating
```

## Overview

Use this wrapper when a change in the property value invalidates the display, layout, configuration, constraints, or intrinsic sizing of a view. This wrapper performs any actions necessary to notify the system that your view is invalid and requires an update. The actions depend on the invalidation types you specify. For more information on available invalidation types, see [`UIViewInvalidating`](/documentation/UIKit/UIViewInvalidating).

The following example uses the [`UIView.Invalidating`](/documentation/UIKit/UIView/Invalidating) wrapper with the `display` type on the property `badgeColor` and the `display` and `layout` type on the property `badgePosition`.

```swift
class MyView: UIView {
    @Invalidating(.display) var badgeColor: UIColor
    
    @Invalidating(.display, .layout) var badgePosition: UIRectEdge
}
```

When you change the badge color, the property wrapper calls [`setNeedsDisplay()`](/documentation/UIKit/UIView/setNeedsDisplay()), causing the system to redraw the view. When you change the badge position, the property wrapper also calls [`setNeedsLayout()`](/documentation/UIKit/UIView/setNeedsLayout()), causing the system to update the view’s subviews before it redraws.

Functions such as [`setNeedsDisplay()`](/documentation/UIKit/UIView/setNeedsDisplay()) and [`setNeedsLayout()`](/documentation/UIKit/UIView/setNeedsLayout()) perform changes on the next update cycle. You can make changes to multiple properties and views before any of those views update. Consolidating the updates to one update cycle is usually better for performance.

> Note:
> You only use ``doc://com.apple.uikit/documentation/UIKit/UIView/Invalidating`` on subclasses of ``doc://com.apple.uikit/documentation/UIKit/UIView``.

## Topics

### Creating an Invalidating Property Wrapper

[`init(wrappedValue:_:)`](/documentation/UIKit/UIView/Invalidating/init(wrappedValue:_:))

Creates a property wrapper that notifies the system when a change in the property value invalidates an aspect of the containing view.

[`init(wrappedValue:_:_:)`](/documentation/UIKit/UIView/Invalidating/init(wrappedValue:_:_:))

Creates a property wrapper that notifies the system when a change in the property value invalidates aspects of the containing view.

[`init(wrappedValue:_:_:_:)`](/documentation/UIKit/UIView/Invalidating/init(wrappedValue:_:_:_:))

Creates a property wrapper that notifies the system when a change in the property value invalidates aspects of the containing view.

[`init(wrappedValue:_:_:_:_:)`](/documentation/UIKit/UIView/Invalidating/init(wrappedValue:_:_:_:_:))

Creates a property wrapper that notifies the system when a change in the property value invalidates aspects of the containing view.

[`init(wrappedValue:_:_:_:_:_:)`](/documentation/UIKit/UIView/Invalidating/init(wrappedValue:_:_:_:_:_:))

Creates a property wrapper that notifies the system when a change in the property value invalidates aspects of the containing view.

[`init(wrappedValue:_:_:_:_:_:_:)`](/documentation/UIKit/UIView/Invalidating/init(wrappedValue:_:_:_:_:_:_:))

Creates a property wrapper that notifies the system when a change in the property value invalidates aspects of the containing view.

[`init(wrappedValue:_:_:_:_:_:_:_:)`](/documentation/UIKit/UIView/Invalidating/init(wrappedValue:_:_:_:_:_:_:_:))

Creates a property wrapper that notifies the system when a change in the property value invalidates aspects of the containing view.

[`init(wrappedValue:_:_:_:_:_:_:_:_:)`](/documentation/UIKit/UIView/Invalidating/init(wrappedValue:_:_:_:_:_:_:_:_:))

Creates a property wrapper that notifies the system when a change in the property value invalidates aspects of the containing view.

[`init(wrappedValue:_:_:_:_:_:_:_:_:_:)`](/documentation/UIKit/UIView/Invalidating/init(wrappedValue:_:_:_:_:_:_:_:_:_:))

Creates a property wrapper that notifies the system when a change in the property value invalidates aspects of the containing view.

[`init(wrappedValue:_:_:_:_:_:_:_:_:_:_:)`](/documentation/UIKit/UIView/Invalidating/init(wrappedValue:_:_:_:_:_:_:_:_:_:_:))

Creates a property wrapper that notifies the system when a change in the property value invalidates aspects of the containing view.



---

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)