---
title: UndoManager.WillUndoChangeMessage
framework: foundation
role: symbol
role_heading: Structure
path: foundation/undomanager/willundochangemessage
---

# UndoManager.WillUndoChangeMessage

A message that an undo manager sends before undoing a change.

## Declaration

```swift
struct WillUndoChangeMessage
```

## Overview

Overview The undo manager posts this message after you call undo() or undoNestedGroup(). Because this is a “will”-style message, the undo manager sends the message before it performs the undo. Observe this message with the identifier willUndoChange, or specify its type directly to the addObserver(of:for:using:) method. The Subject of this message type is UndoManager. This message interoperates with the notification NSUndoManagerWillUndoChange. The system notifies observers of the message when the NotificationCenter posts the notification. Similarly, the system notifies observers of the notification when it posts the message.

## Topics

### Initializers

- [init()](foundation/undomanager/willundochangemessage/init().md)

## Relationships

### Conforms To

- [NotificationCenter.MainActorMessage](foundation/notificationcenter/mainactormessage.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Working with notification messages

- [UndoManager.DidUndoChangeMessage](foundation/undomanager/didundochangemessage.md)
- [UndoManager.WillRedoChangeMessage](foundation/undomanager/willredochangemessage.md)
- [UndoManager.DidRedoChangeMessage](foundation/undomanager/didredochangemessage.md)
- [UndoManager.CheckpointMessage](foundation/undomanager/checkpointmessage.md)
- [UndoManager.DidOpenUndoGroupMessage](foundation/undomanager/didopenundogroupmessage.md)
- [UndoManager.WillCloseUndoGroupMessage](foundation/undomanager/willcloseundogroupmessage.md)
- [UndoManager.DidCloseUndoGroupMessage](foundation/undomanager/didcloseundogroupmessage.md)
