Contents

selectionGranularity

The selection granularity for subsequent extension of a selection.

Declaration

var selectionGranularity: NSSelectionGranularity { get set }

Discussion

Selection granularity is used to determine how the selection is modified when the user Shift-clicks or drags the mouse after a double or triple click. For example, if the user selects a word by double-clicking, the selection granularity is set to NSSelectByWord. Subsequent Shift-clicks then extend the selection by words.

Selection granularity is reset to NSSelectByCharacter whenever the selection is set. You should always set the selection granularity after setting the selection.

See Also

Managing the selection