NSAttributedString
NSAttributedString is a Cocoa and Foundation class that represents a string together with a collection of attributes that apply to ranges within the string. Each range carries a dictionary of attributes such as font, color, paragraph style, or links. The class is immutable; editing is performed with NSMutableAttributedString, a mutable subclass.
Attributes are specified with keys like NSFontAttributeName, NSForegroundColorAttributeName, NSParagraphStyleAttributeName, NSLinkAttributeName, and NSAttachmentAttributeName, among others. In Swift,
An attributed string stores a single plain string plus one or more attribute dictionaries associated with
NSAttributedString supports initialization from a plain string or from serialized formats such as RTF or HTML
This structure is commonly used to present rich text in apps, enabling per-range styling within a single