Instance Method

setSelectedDOMRange(_:affinity:)

Selects a range of nodes.

Declaration

func setSelectedDOMRange(_ range: DOMRange!, affinity selectionAffinity: NSSelectionAffinity)

Parameters

range

The range of nodes to select. If range is nil, the current selection is cleared. This method raises a DOMRangeExcepton if the range has been detached or refers to nodes not displayed by the receiver.

selectionAffinity

See the selectionAffinity property for information on selection affinity.

See Also

Selecting Content in the Document

var selectedDOMRange: DOMRange!

The range of the current selection.

var selectionAffinity: NSSelectionAffinity

The current selection affinity.