---
title: leafKeyPath
framework: appkit
role: symbol
role_heading: Instance Property
path: appkit/nstreecontroller/leafkeypath
---

# leafKeyPath

The key path used by the tree controller to determine if a node is a leaf key.

## Declaration

```swift
var leafKeyPath: String? { get set }
```

## Discussion

Discussion Specifying a key path for this property is optional. If the tree controller is able to determine that a node is a leaf node, it can disable inserting or adding children to those nodes.

## See Also

### Specifying model attributes

- [childrenKeyPath](appkit/nstreecontroller/childrenkeypath.md)
- [childrenKeyPath(for:)](appkit/nstreecontroller/childrenkeypath(for:).md)
- [countKeyPath](appkit/nstreecontroller/countkeypath.md)
- [countKeyPath(for:)](appkit/nstreecontroller/countkeypath(for:).md)
- [leafKeyPath(for:)](appkit/nstreecontroller/leafkeypath(for:).md)
