Contents

replaceSelection(withMarkupString:)

Replaces the current selection with mixed text and markup.

Declaration

func replaceSelection(withMarkupString markupString: String!)

Parameters

  • markupString:

    The markup string that replaces the current selection.

Discussion

If the current selection is collapsed (a range is selected with the same nodes and offsets for the start and end) then no content is removed when inserting the markup, and the selection is collapsed and moved to the end of the inserted content. If no content is selected, the markup is not inserted.

See HTML Clipboard Format for a specification of the supported HTML markup.

See Also

Editing Documents