A set of methods that defines the interface to text attachment objects from NSLayout
.
SDKs
- iOS 7.0+
- macOS 10.11+
- Mac Catalyst 13.0+
- tvOS 9.0+
Frameworks
- UIKit
- App
Kit
Declaration
protocol NSTextAttachmentContainer
A set of methods that defines the interface to text attachment objects from NSLayout
.
SDKs
Frameworks
protocol NSTextAttachmentContainer
func attachment Bounds(for: NSText Container?, proposed Line Fragment: CGRect, glyph Position: CGPoint, character Index: Int) -> CGRect
Returns the layout bounds of the text attachment to the layout manager.
Required.
func image(for Bounds: CGRect, text Container: NSText Container?, character Index: Int) -> UIImage?
Returns the image object rendered by the layout manager in the given image bounds rectangle inside the text container.
Required.
class NSText Attachment
The values for the attachment attributes of attributed strings and related objects.