Contents

completions(forPartialWordRange:indexOfSelectedItem:)

Returns an array of potential completions, in the order to be presented, representing possible word completions available from a partial word.

Declaration

func completions(forPartialWordRange charRange: NSRange, indexOfSelectedItem index: UnsafeMutablePointer<Int>) -> [String]?

Parameters

  • charRange:

    The range of characters of the matched partial word to be completed.

  • index:

    On return, optionally set to the completion that should be initially selected. The default is 0, and –1 indicates no selection.

Return Value

An array of potential completions, in the order to be presented, representing possible word completions available from a partial word at charRange. Returning nil or a zero-length array suppresses completion.

Discussion

May be overridden by subclasses to modify or override the list of possible completions.

This method should call the delegate method textView(_:completions:forPartialWordRange:indexOfSelectedItem:) if the delegate implements such a method.

See Also

Performing text completion