---
title: allowsEmptySelection
framework: appkit
role: symbol
role_heading: Instance Property
path: appkit/nscollectionview/allowsemptyselection
---

# allowsEmptySelection

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

## Declaration

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

## Discussion

Discussion The default value of this property is true, which allows the collection view to have no selected items. Setting this property to false causes the collection view to always leave at least one item selected.

## See Also

### Managing the Selection

- [isSelectable](appkit/nscollectionview/isselectable.md)
- [allowsMultipleSelection](appkit/nscollectionview/allowsmultipleselection.md)
- [selectionIndexPaths](appkit/nscollectionview/selectionindexpaths.md)
- [selectAll(_:)](appkit/nscollectionview/selectall(_:).md)
- [deselectAll(_:)](appkit/nscollectionview/deselectall(_:).md)
- [selectItems(at:scrollPosition:)](appkit/nscollectionview/selectitems(at:scrollposition:).md)
- [deselectItems(at:)](appkit/nscollectionview/deselectitems(at:).md)
