The values for the attachment attributes of attributed strings and related objects.
SDKs
- iOS 7.0+
- macOS 10.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
Frameworks
- UIKit
- App
Kit
Declaration
class NSTextAttachment : NSObject
Overview
The NSAttributed
class cluster uses text attachment objects as the values for attachment attributes (stored in the attributed string under the key named attachment
).
A text attachment object contains either an NSData
object or an File
object, which in turn holds the contents of the attached file. The properties of this class configure the appearance of the text attachment in your interface. In macOS, the text attachment also uses a cell object conforming to the NSText
protocol to draw and handle mouse events.
For more information about text attachments, see the NSAttributed
and NSText
.