textLayoutManager(_:textLayoutFragmentFor:in:)
The method the framework calls to give the delegate an opportunity to return a custom text layout fragment.
Declaration
optional func textLayoutManager(_ textLayoutManager: NSTextLayoutManager, textLayoutFragmentFor location: any NSTextLocation, in textElement: NSTextElement) -> NSTextLayoutFragmentParameters
- textLayoutManager:
The text layout manager.
- location:
The Nstextlocation of the link in the text element.
- textElement:
The Nstextelement that the method could return a custom Nstextlayoutfragment from.
Return Value
Discussion
Use this to provide an NSTextLayoutFragment specialized for an NSTextElement subclass targeted for the rendering surface.