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

# textDidChange(_:)

Invoked when a key-down event or paste operation occurs that changes the receiver’s contents.

```
func textDidChange(_ notification: Notification)
```

## Parameters

`notification`

The [`textDidChangeNotification`](/documentation/AppKit/NSControl/textDidChangeNotification) notification.

## Discussion

This method’s default behavior is to pass this message on to the selected cell (if the selected cell responds to `textDidChange:`) and then to post an [`textDidChangeNotification`](/documentation/AppKit/NSControl/textDidChangeNotification) along with the receiving object to the default notification center. The posted notification’s user info contains the contents of notification’s user info dictionary, plus an additional key-value pair. The additional key is “`NSFieldEditor`”; the value for this key is the text object that changed.

---

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)