<!--
{
  "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/performEditingTransaction(for:using:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSTextStorageObserving(im)performEditingTransactionForTextStorage:usingBlock:"
  },
  "title" : "performEditingTransaction(for:using:)"
}
-->

# performEditingTransaction(for:using:)

Performs an editing transaction on the text storage.

```
func performEditingTransaction(for textStorage: NSTextStorage, using transaction: () -> Void)
```

## Parameters

`textStorage`

The text storage.

`transaction`

The block to execute within the transaction.

---

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)