---
title: "searchCompletion(_:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/view/searchcompletion(_:)"
---

# searchCompletion(_:)

Associates a fully formed string with the value of this view when used as a search suggestion.

## Declaration

```swift
nonisolated func searchCompletion(_ completion: String) -> some View

```

## Parameters

- `completion`: A string to use as the view’s completion.

## Mentioned in

Suggesting search terms

## Discussion

Discussion Use this method to associate a fully formed string with a view that is within a search suggestion list context. The system uses this value when the view is selected to replace the partial text being currently edited of the associated search field. On tvOS, the string that you provide to the this modifier is used when displaying the associated suggestion and when replacing the partial text of the search field. SearchPlaceholderView()     .searchable(text: $text) {         Text("🍎").searchCompletion("apple")         Text("🍐").searchCompletion("pear")         Text("🍌").searchCompletion("banana")     }

## See Also

### Making search suggestions

- [Suggesting search terms](swiftui/suggesting-search-terms.md)
- [searchSuggestions(_:)](swiftui/view/searchsuggestions(_:).md)
- [searchSuggestions(_:for:)](swiftui/view/searchsuggestions(_:for:).md)
- [searchable(text:tokens:suggestedTokens:placement:prompt:token:)](swiftui/view/searchable(text:tokens:suggestedtokens:placement:prompt:token:).md)
- [SearchSuggestionsPlacement](swiftui/searchsuggestionsplacement.md)
