Contents

selectedRange()

Returns the range of selected text.

Declaration

func selectedRange() -> NSRange

Return Value

The range of selected text or {NSNotFound, 0} if there is no selection.

Discussion

The returned range measures from the start of the receiver’s text storage, that is, from 0 to the document length.

See Also

Handling marked text