<!--
{
  "availability" : [
    "macOS: 10.11.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSCollectionView/allowsEmptySelection",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSCollectionView(py)allowsEmptySelection"
  },
  "title" : "allowsEmptySelection"
}
-->

# allowsEmptySelection

A Boolean value indicating whether the collection view may have no selected items.

```
var allowsEmptySelection: Bool { get set }
```

## Discussion

The default value of this property is <doc://com.apple.documentation/documentation/Swift/true>, which allows the collection view to have no selected items. Setting this property to <doc://com.apple.documentation/documentation/Swift/false> causes the collection view to always leave at least one item selected.

---

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)