Contents

setSelectedRange(_:)

Selects the specified range of characters in response to user action.

Declaration

func setSelectedRange(_ charRange: NSRange)

Parameters

  • charRange:

    The range of characters to select. The range must begin and end on glyph boundaries and not split base glyphs and their nonspacing marks.

Discussion

Calling this method resets the selectionGranularity property to NSSelectionGranularity.selectByCharacter and the selectionAffinity property to NSSelectionAffinity.upstream.

See Also

Managing the selection