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) -> NSTextSelectionParameters
- 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.