<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/NSTextStorageObserving",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSTextStorageObserving"
  },
  "title" : "NSTextStorageObserving"
}
-->

# NSTextStorageObserving

Optional methods that delegates implement to handle editing and transaction processing.

```
protocol NSTextStorageObserving : NSObjectProtocol
```

## Topics

### Accessing the text storage

[`var textStorage: NSTextStorage?`](/documentation/UIKit/NSTextStorageObserving/textStorage)

The document text storage object.

### Managing the editing process

[`func performEditingTransaction(for: NSTextStorage, using: () -> Void)`](/documentation/UIKit/NSTextStorageObserving/performEditingTransaction(for:using:))

Performs an editing transaction on the text storage.

[`func processEditing(for: NSTextStorage, edited: NSTextStorage.EditActions, range: NSRange, changeInLength: Int, invalidatedRange: NSRange)`](/documentation/UIKit/NSTextStorageObserving/processEditing(for:edited:range:changeInLength:invalidatedRange:))

Notifies the observer that the text storage has been edited.

## Relationships

### Conforming Types

[`NSTextContentStorage`](/documentation/UIKit/NSTextContentStorage)

### Inherits From

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

---

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)