---
title: avoidsEmptySelection
framework: appkit
role: symbol
role_heading: Instance Property
path: appkit/nstreecontroller/avoidsemptyselection
---

# avoidsEmptySelection

A Boolean value that indicates whether the tree controller requires the content array to attempt to maintain a selection at all times, avoiding an empty selection.

## Declaration

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

## Discussion

Discussion When the value of this property is true, the tree controller maintains a selection unless there are no objects in the content. The default value is true. This property is observable using key-value observing.

## See Also

### Managing Selections

- [selectsInsertedObjects](appkit/nstreecontroller/selectsinsertedobjects.md)
- [addSelectionIndexPaths(_:)](appkit/nstreecontroller/addselectionindexpaths(_:).md)
- [removeSelectionIndexPaths(_:)](appkit/nstreecontroller/removeselectionindexpaths(_:).md)
- [preservesSelection](appkit/nstreecontroller/preservesselection.md)
- [alwaysUsesMultipleValuesMarker](appkit/nstreecontroller/alwaysusesmultiplevaluesmarker.md)
