---
title: undoCount
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/undomanager/undocount
---

# undoCount

The number of times you can invoke undo before there are no actions left to undo.

## Declaration

```swift
var undoCount: Int { get }
```

## Discussion

Discussion A nonzero value doesn’t imply you can safely invoke undo() immediately, because you may have to close open undo groups first.

## See Also

### Managing undo and redo stack depth

- [levelsOfUndo](foundation/undomanager/levelsofundo.md)
- [redoCount](foundation/undomanager/redocount.md)
