Contents

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) -> NSTextLayoutFragment

Parameters

Return Value

An NSTextLayoutFragment.

Discussion

Use this to provide an NSTextLayoutFragment specialized for an NSTextElement subclass targeted for the rendering surface.

See Also

Responding to layout changes