<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSTextView/willChangeNotifyingTextViewNotification",
  "metadataVersion" : "0.1.0",
  "role" : "Type Property",
  "symbol" : {
    "kind" : "Type Property",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:@NSTextViewWillChangeNotifyingTextViewNotification"
  },
  "title" : "willChangeNotifyingTextViewNotification"
}
-->

# willChangeNotifyingTextViewNotification

Posted when a new text view is established as the text view that sends notifications.

```
class let willChangeNotifyingTextViewNotification: NSNotification.Name
```

## Discussion

This notification allows observers to reregister themselves for the new text view. Methods such as [`removeTextContainer(at:)`](/documentation/AppKit/NSLayoutManager/removeTextContainer(at:)), [`textContainerChangedTextView(_:)`](/documentation/AppKit/NSLayoutManager/textContainerChangedTextView(_:)), and [`insertTextContainer(_:at:)`](/documentation/AppKit/NSLayoutManager/insertTextContainer(_:at:)) cause this notification to be posted.

The notification object is the old notifying text view, or `nil`. The `userInfo` dictionary contains the following information:

|Key                        |Value                                                |
|---------------------------|-----------------------------------------------------|
|`@"NSOldNotifyingTextView"`|The old `NSTextView`, if one exists, otherwise `nil`.|
|`@"NSNewNotifyingTextView"`|The new `NSTextView`, if one exists, otherwise `nil`.|

There’s no delegate method associated with this notification. The text-handling system ensures that when a new text view replaces an old one as the notifying text view, the existing delegate becomes the delegate of the new text view, and the delegate is registered to receive text view notifications from the new notifying text view. All other observers are responsible for registering themselves on receiving this notification.

## See Also

  <doc://com.apple.documentation/documentation/Foundation/NotificationCenter/removeObserver(_:)-2yciv>

  <doc://com.apple.documentation/documentation/Foundation/NotificationCenter/addObserver(_:selector:name:object:)>

To observe this notification using Swift concurrency, use [`NSTextView.WillChangeNotifyingTextViewMessage`](/documentation/AppKit/NSTextView/WillChangeNotifyingTextViewMessage).

---

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)