Contents

frameForTextAttachment(at:)

Returns the frame in the text layout fragment coordinate system for the attachment at the location you specify.

Declaration

func frameForTextAttachment(at location: any NSTextLocation) -> CGRect

Parameters

  • location:

    The Nstextlocation that describes the location in the text layout fragment.

Return Value

The frame rectangle that describes the text layout fragment.

Discussion

Returns CGRectZero if location isn’t with any attachment or the state isn’t NSTextLayoutFragment.State.layoutAvailable.

See Also

Drawing the fragment and attachments