NSMutableAttributedString
NSMutableAttributedString is a mutable subclass of NSAttributedString in the Foundation framework. It represents a string together with per-range attributes, allowing both the characters and their styling to be edited after creation. This makes it the primary data structure for building and modifying richly formatted text in Cocoa and Cocoa Touch applications.
Like NSAttributedString, an NSMutableAttributedString stores attributes as key–value pairs associated with specific ranges of the string.
Common operations include appending or inserting attributed substrings, replacing characters, and changing attributes for selected ranges.
Usage contexts include rendering rich text in UI elements such as UILabel’s attributedText or UITextView, as