<!--
{
  "availability" : [
    "macOS: 10.11.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSLayoutManager/processEditing(for:edited:range:changeInLength:invalidatedRange:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSLayoutManager(im)processEditingForTextStorage:edited:range:changeInLength:invalidatedRange:"
  },
  "title" : "processEditing(for:edited:range:changeInLength:invalidatedRange:)"
}
-->

# processEditing(for:edited:range:changeInLength:invalidatedRange:)

Notifies the layout manager when an edit action changes the contents of its text storage object.

```
func processEditing(for textStorage: NSTextStorage, edited editMask: NSTextStorageEditActions, range newCharRange: NSRange, changeInLength delta: Int, invalidatedRange invalidatedCharRange: NSRange)
```

## Parameters

`textStorage`

The text storage object processing edits.

`editMask`

The types of edits done: `NSTextStorageEditedAttributes`, `NSTextStorageEditedCharacters`, or both.

`newCharRange`

The range in the final string that was explicitly edited.

`delta`

The length delta for the editing changes.

`invalidatedCharRange`

The range of characters that changed as a result of attribute fixing. This invalidated range is either equal to `newCharRange` or larger.

## Discussion

The [`processEditing()`](/documentation/AppKit/NSTextStorage/processEditing()) method of [`NSTextStorage`](/documentation/AppKit/NSTextStorage) calls this method to notify the layout manager of an edit action. Layout managers must not change the contents of the text storage during the execution of this message.

---

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)