Contents

addRenderingAttribute(_:value:for:)

Sets the rendering attribute for the value and range you specify.

Declaration

func addRenderingAttribute(_ renderingAttribute: NSAttributedString.Key, value: Any?, for textRange: NSTextRange)

Parameters

  • renderingAttribute:

    The Key that represents the attribute.

  • value:

    The value for the attribute.

  • textRange:

    The range over which to apply the attribute.

Discussion

Passing nil overrides the specified attribute by removing it from the final attributes the framework passes to the layout and rendering engine. This is a convenience method for setRenderingAttributes(_:for:).

See Also

Adjusting rendering