Contents

textSelection(for:enclosing:inContainerAt:)

Returns a text selection that expands to the nearest boundaries for selection granularity and an enclosing point you specify.

Declaration

func textSelection(for selectionGranularity: NSTextSelection.Granularity, enclosing point: CGPoint, inContainerAt location: any NSTextLocation) -> NSTextSelection?

Parameters

Return Value

A new NSTextSelection, or nil if the text selection is not found.

See Also

Selection characteristics