Contents

addTemporaryAttribute(_:value:forCharacterRange:)

Adds a temporary attribute to the characters in the specified range.

Declaration

func addTemporaryAttribute(_ attrName: NSAttributedString.Key, value: Any, forCharacterRange charRange: NSRange)

Parameters

  • attrName:

    The name of a temporary attribute.

  • value:

    The temporary attribute value associated with attrName.

  • charRange:

    The range of characters to which the specified attribute-value pair applies.

Discussion

Raises an invalidArgumentException if attrName or value is nil.

See Also

Managing temporary attribute support