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

# didEndEditingNotification

Posted when focus leaves an `NSText` object, whether or not any operation has changed characters or formatting attributes.

```
class let didEndEditingNotification: NSNotification.Name
```

## Discussion

The notification object is the notifying `NSText` object. The `userInfo` dictionary contains the following information:

|Key                                                                       |Value                                                                               |
|--------------------------------------------------------------------------|------------------------------------------------------------------------------------|
|``doc://com.apple.appkit/documentation/AppKit/NSText/movementUserInfoKey``|One of the values in ``doc://com.apple.appkit/documentation/AppKit/NSTextMovement``.|

|Key                |Value                                                                                                       |
|-------------------|------------------------------------------------------------------------------------------------------------|
|`@"NSTextMovement"`|Possible movement code values are described in <doc://com.apple.appkit/documentation/AppKit/movement-codes>.|

> Note:
> It is common for ``doc://com.apple.appkit/documentation/AppKit/NSText/didEndEditingNotification`` to be sent without a matching ``doc://com.apple.appkit/documentation/AppKit/NSText/didBeginEditingNotification``. The begin notification is only sent if the user actually makes changes (that is, types something or changes formatting attributes). However, the end notification is sent when focus leaves the text view, regardless of whether there was a change.
> 
> This distinction enables an application to know whether the user actually made a change to the text or just clicked in the text view and then clicked outside it. In both cases, ``doc://com.apple.appkit/documentation/AppKit/NSText/didEndEditingNotification`` is sent, but to tell the difference, the application can listen for ``doc://com.apple.appkit/documentation/AppKit/NSText/didBeginEditingNotification``.

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

---

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)