Contents

textLayoutManager(_:renderingAttributesForLink:at:defaultAttributes:)

Returns a dictionary of rendering attributes for rendering a link.

Declaration

optional func textLayoutManager(_ textLayoutManager: NSTextLayoutManager, renderingAttributesForLink link: Any, at location: any NSTextLocation, defaultAttributes renderingAttributes: [NSAttributedString.Key : Any] = [:]) -> [NSAttributedString.Key : Any]?

Parameters

  • textLayoutManager:

    The text layout manager sending the message.

  • link:

    The link object.

  • location:

    The document location of the link.

  • renderingAttributes:

    The default rendering attributes.

Return Value

A dictionary of rendering attributes for the link, or nil to use defaults.

Discussion

Just as other rendering attributes, specifying NSNull removes the attribute from the final attributes used for rendering. It has priority over the general rendering attributes.

The method the framework calls to return a dictionary of attributes for rendering a link attribute name.

See Also

Responding to layout changes