<!--
{
  "availability" : [
    "iOS: 7.0.0 -",
    "iPadOS: 7.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/NSTextStorageDelegate/textStorage(_:didProcessEditing:range:changeInLength:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSTextStorageDelegate(im)textStorage:didProcessEditing:range:changeInLength:"
  },
  "title" : "textStorage(_:didProcessEditing:range:changeInLength:)"
}
-->

# textStorage(_:didProcessEditing:range:changeInLength:)

The method the framework calls when a text storage object has finished processing edits.

```
optional func textStorage(_ textStorage: NSTextStorage, didProcessEditing editedMask: NSTextStorage.EditActions, range editedRange: NSRange, changeInLength delta: Int)
```

## Parameters

`textStorage`

The text storage object processing edits.

`editedMask`

The types of edits done: [`editedAttributes`](/documentation/UIKit/NSTextStorage/EditActions/editedAttributes), [`editedCharacters`](/documentation/UIKit/NSTextStorage/EditActions/editedCharacters), or both.

`editedRange`

The range in the original string (before the edit).

`delta`

The length delta for the editing changes.

## Discussion

Sent inside [`processEditing()`](/documentation/UIKit/NSTextStorage/processEditing()) right before notifying layout managers. Delegates can change the attributes.

The delegate can verify the final state of the text storage object; it can’t change the text storage object’s characters without leaving it in an inconsistent state, but if necessary it can change attributes. Note that even in this case it’s possible to put a text storage object into an inconsistent state—for example, by changing the font of a range to one that doesn’t support the characters in that range, such as using a Latin font for Kanji text.

---

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)