Contents

textSelection(for:enclosing:)

Returns a text selection expanded to the nearest boundaries for the selection granularity and enclosing text selection text ranges you specify.

Declaration

func textSelection(for selectionGranularity: NSTextSelection.Granularity, enclosing textSelection: NSTextSelection) -> NSTextSelection

Parameters

  • selectionGranularity:

    One of the available Granularity Swift.enum options.

  • textSelection:

    The text selection that describes the text range of interest.

Return Value

A new text selection.

See Also

Working with text selections