attachmentBounds(for:location:textContainer:proposedLineFragment:position:)
Returns the layout bounds for an attachment at a specific text location that contains the text attributes you specify.
Declaration
func attachmentBounds(for attributes: [NSAttributedString.Key : Any], location: any NSTextLocation, textContainer: NSTextContainer?, proposedLineFragment: CGRect, position: CGPoint) -> CGRectParameters
- attributes:
A dictionary that contains a list of key and attribute pairs that describe the customization of the string.
- location:
An Nstextlocation that indicates that start of the string.
- textContainer:
The Nstextcontainer that contains the source string.
- proposedLineFragment:
A Cgrect that describes the boundaries of the line fragment.
- position:
A Cgpoint inside
proposedLineFragment.
Return Value
Returns a CGRect that describes the bounds of the attachment.