---
title: groupsByEvent
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/undomanager/groupsbyevent
---

# groupsByEvent

A Boolean value that indicates whether the manager automatically creates undo groups around each pass of the run loop.

## Declaration

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

## Discussion

Discussion true if the manager automatically creates undo groups around each pass of the run loop, otherwise false. The default is true. If you turn automatic grouping off, you must close groups explicitly before invoking either undo() or undoNestedGroup().

## See Also

### Creating undo groups

- [beginUndoGrouping()](foundation/undomanager/beginundogrouping().md)
- [endUndoGrouping()](foundation/undomanager/endundogrouping().md)
- [groupingLevel](foundation/undomanager/groupinglevel.md)
