Contents

insert(_:at:)

Inserts the characters and attributes of the given attributed string into the receiver at the given index.

Declaration

func insert(_ attrString: NSAttributedString, at loc: Int)

Parameters

  • attrString:

    The string whose characters and attributes are inserted.

  • loc:

    The index at which the characters and attributes are inserted.

Discussion

The new characters and attributes begin at the given index and the existing characters and attributes from the index to the end of the receiver are shifted by the length of the attributed string. Raises an rangeException if loc lies beyond the end of the receiver’s characters.

See Also

Changing Characters and Attributes