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

# collectionView(_:didDeselectItemsAt:)

Notifies the delegate object that one or more items were deselected.

```
@MainActor optional func collectionView(_ collectionView: NSCollectionView, didDeselectItemsAt indexPaths: Set<IndexPath>)
```

## Parameters

`collectionView`

The collection view notifying you of the selection change.

`indexPaths`

The set of <doc://com.apple.documentation/documentation/Foundation/NSIndexPath> objects corresponding to the items that were deselected.

## Discussion

After the user successfully deselects one or more items, the collection view calls this method to let you know that the items are no longer selected. Use this method to respond to the selection change and to make any necessary adjustments to your content or the collection view.

This method is not called when you set the selection programmatically using the methods of the [`NSCollectionView`](/documentation/AppKit/NSCollectionView) class.

---

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)