<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -",
    "watchOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/UndoManager/WillUndoChangeMessage",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "s:So13NSUndoManagerC10FoundationE21WillUndoChangeMessageV"
  },
  "title" : "UndoManager.WillUndoChangeMessage"
}
-->

# UndoManager.WillUndoChangeMessage

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

```
struct WillUndoChangeMessage
```

## Overview

The undo manager posts this message after you call [`undo()`](/documentation/Foundation/UndoManager/undo()) or [`undoNestedGroup()`](/documentation/Foundation/UndoManager/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`](/documentation/Foundation/NotificationCenter/MessageIdentifier/willUndoChange), or specify its type directly to the `addObserver(of:for:using:)` method.
The [`Subject`](/documentation/Foundation/NotificationCenter/MainActorMessage/Subject) of this message type is [`UndoManager`](/documentation/Foundation/UndoManager).

This message interoperates with the notification [`NSUndoManagerWillUndoChange`](/documentation/Foundation/NSNotification/Name-swift.struct/NSUndoManagerWillUndoChange).
The system notifies observers of the message when the [`NotificationCenter`](/documentation/Foundation/NotificationCenter) posts the notification.
Similarly, the system notifies observers of the notification when it posts the message.

## Topics

### Initializers

[`init()`](/documentation/Foundation/UndoManager/WillUndoChangeMessage/init())

Creates a will undo change message.

## Relationships

### Conforms To

[`MainActorMessage`](/documentation/Foundation/NotificationCenter/MainActorMessage)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Sendable`](/documentation/Swift/Sendable)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)