---
title: canUndo
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/undomanager/canundo
---

# canUndo

A Boolean value that indicates whether the manager has any actions to undo.

## Declaration

```swift
var canUndo: Bool { get }
```

## Discussion

Discussion true if the manager has any actions to undo, otherwise false. The return value doesn’t mean you can safely invoke undo() or undoNestedGroup()—you may have to close open undo groups first.

## See Also

### Related Documentation

- [registerUndo(withTarget:selector:object:)](foundation/undomanager/registerundo(withtarget:selector:object:).md)
- [enableUndoRegistration()](foundation/undomanager/enableundoregistration().md)

### Checking undo ability

- [canRedo](foundation/undomanager/canredo.md)
