<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSMutableAttributedString/beginEditing()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSMutableAttributedString(im)beginEditing"
  },
  "title" : "beginEditing()"
}
-->

# beginEditing()

Begins the buffering of changes to the string’s characters and attributes.

```
func beginEditing()
```

## Discussion

Override this method in a subclass to buffer or optimize a series of changes to the string’s characters or attributes. The string continues to buffer text until you call [`endEditing()`](/documentation/Foundation/NSMutableAttributedString/endEditing()), at which time it consolidates the changes and notifies observers.

You can nest pairs of [`beginEditing()`](/documentation/Foundation/NSMutableAttributedString/beginEditing()) and [`endEditing()`](/documentation/Foundation/NSMutableAttributedString/endEditing()) messages.

---

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)