<!--
{
  "availability" : [
    "macOS: 10.11.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSCollectionViewDelegate/collectionView(_:didChangeItemsAt:to:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSCollectionViewDelegate(im)collectionView:didChangeItemsAtIndexPaths:toHighlightState:"
  },
  "title" : "collectionView(_:didChangeItemsAt:to:)"
}
-->

# collectionView(_:didChangeItemsAt:to:)

Notifies the delegate that the highlight state of the specified items changed.

```
@MainActor optional func collectionView(_ collectionView: NSCollectionView, didChangeItemsAt indexPaths: Set<IndexPath>, to highlightState: NSCollectionViewItem.HighlightState)
```

## Parameters

`collectionView`

The collection view notifying you of the highlight change.

`indexPaths`

The set of <doc://com.apple.documentation/documentation/Foundation/NSIndexPath> objects corresponding to the items whose highlight state changed.

`highlightState`

The new highlight state of the items.

## Discussion

After the highlight state of one or more items changes successfully, the collection view calls this method to report the change. Use this method to respond to the change and to make any necessary adjustments to your content or the collection 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)