NSTextStorage class defines the fundamental storage mechanism of TextKit. This class is a semi concrete subclass of
NSMutableAttributedString that adds behavior for managing a set of client
NSLayoutManager objects. A text storage object notifies its layout managers of changes to its characters or attributes, which lets the layout managers redisplay the text as needed.
- iOS 7.0+
- macOS 10.0+
- tvOS 7.0+
NSTextStorage object can be accessed from any thread of your app, but your app must guarantee access from only one thread at a time.
NSTextStorage class implements change management (via the
endEditing() methods), verification of attributes, delegate handling, and layout management notification. The one aspect it does not implement is managing the actual attributed string storage, which subclasses manage by overriding the two
Subclasses must also override two
These primitives should perform the change, then call
edited(_:range:changeInLength:) to let the parent class know what changes were made.