<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: -",
    "tvOS: 15.0.0 -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UICollectionViewCell/configurationUpdateHandler-7rqbu",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "s:So20UICollectionViewCellC5UIKitE26configurationUpdateHandleryAB_AC24UICellConfigurationStateVtcSgvp"
  },
  "title" : "configurationUpdateHandler"
}
-->

# configurationUpdateHandler

A block for handling updates to the cell’s configuration using the current state.

```
@MainActor @preconcurrency var configurationUpdateHandler: UICollectionViewCell.ConfigurationUpdateHandler? { get set }
```

## Discussion

A configuration update handler provides an alternative approach to overriding [`updateConfiguration(using:)`](/documentation/UIKit/UICollectionViewCell/updateConfiguration(using:)) in a subclass. Set a configuration update handler to update the cell’s configuration using the new state in response to a configuration state change:

```swift
cell.configurationUpdateHandler = { cell, state in
    var content = UIListContentConfiguration.cell().updated(for: state)
    content.text = "Hello world!"
    if state.isDisabled {
        content.textProperties.color = .systemGray
    }
    cell.contentConfiguration = content
}
```

Setting the value of this property calls [`setNeedsUpdateConfiguration()`](/documentation/UIKit/UICollectionViewCell/setNeedsUpdateConfiguration()). The system calls this handler after calling [`updateConfiguration(using:)`](/documentation/UIKit/UICollectionViewCell/updateConfiguration(using:)).

In iOS 18 and later, UIKit supports automatic trait tracking inside this closure for traits from this cell’s `traitCollection`. For more information, see [Automatic trait tracking](/documentation/UIKit/automatic-trait-tracking).

This closure supports automatic observation tracking. For more information, see [Updating views automatically with observation tracking in UIKit](/documentation/UIKit/updating-views-automatically-with-observation-tracking-in-uikit).

---

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)