---
title: "complete(_:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nstextview/complete(_:)"
---

# complete(_:)

Invokes completion in a text view.

## Declaration

```swift
func complete(_ sender: Any?)
```

## Parameters

- `sender`: The control sending the message. May be nil.

## Discussion

Discussion By default invoked using the F5 key, this method provides users with a choice of completions for the word currently being typed. May be invoked programmatically if autocompletion is desired by a client of the text system. You can change the key invoking this method using the text system’s key bindings mechanism; see “Text System Defaults and Key Bindings” for an explanation of the procedure. The delegate may replace or modify the list of possible completions by implementing textView(_:completions:forPartialWordRange:indexOfSelectedItem:). Subclasses can control the list by overriding completions(forPartialWordRange:indexOfSelectedItem:).

## See Also

### Performing text completion

- [completions(forPartialWordRange:indexOfSelectedItem:)](appkit/nstextview/completions(forpartialwordrange:indexofselecteditem:).md)
- [insertCompletion(_:forPartialWordRange:movement:isFinal:)](appkit/nstextview/insertcompletion(_:forpartialwordrange:movement:isfinal:).md)
- [rangeForUserCompletion](appkit/nstextview/rangeforusercompletion.md)
