<!--
{
  "availability" : [
    "macOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSTextStorage/changeInLength",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSTextStorage(py)changeInLength"
  },
  "title" : "changeInLength"
}
-->

# changeInLength

The difference between the current length of the edited range and its length before editing.

```
var changeInLength: Int { get }
```

## Discussion

This property reflects difference between the current length of the edited range and its length before editing began—that is, before the first call to the <doc://com.apple.documentation/documentation/Foundation/NSMutableAttributedString/beginEditing()> method or a single call to the[`edited(_:range:changeInLength:)`](/documentation/AppKit/NSTextStorage/edited(_:range:changeInLength:)) method. This difference is accumulated with each call to the [`edited(_:range:changeInLength:)`](/documentation/AppKit/NSTextStorage/edited(_:range:changeInLength:)) method, until the changes are finally processed.

The text storage object’s delegate and layout managers can use this information to determine the nature of edits in their respective notification methods.

---

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)