---
title: groupingLevel
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/undomanager/groupinglevel
---

# groupingLevel

The number of nested undo groups (or redo groups, if redo is the most recent operation) in the current event loop.

## Declaration

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

## Discussion

Discussion An integer indicating the number of nested groups. If 0 is returned, there is no open undo or redo group.

## See Also

### Related Documentation

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

### Creating undo groups

- [beginUndoGrouping()](foundation/undomanager/beginundogrouping().md)
- [endUndoGrouping()](foundation/undomanager/endundogrouping().md)
- [groupsByEvent](foundation/undomanager/groupsbyevent.md)
