<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSTextView/didChangeText()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSTextView(im)didChangeText"
  },
  "title" : "didChangeText()"
}
-->

# didChangeText()

Sends out necessary notifications when a text change completes.

```
func didChangeText()
```

## Discussion

Invoked automatically at the end of a series of changes, this method posts an [`didChangeNotification`](/documentation/AppKit/NSText/didChangeNotification) to the default notification center, which also results in the delegate receiving an `NSText` delegate [`textDidChange(_:)`](/documentation/AppKit/NSTextDelegate/textDidChange(_:)) message.

Subclasses implementing methods that change their text should invoke this method at the end of those methods. See [Subclassing NSTextView](https://developer.apple.com/library/archive/documentation/TextFonts/Conceptual/CocoaTextArchitecture/TextEditing/TextEditing.html#//apple_ref/doc/uid/TP40009459-CH3-SW16) for more information.

---

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)