Contents

localizedAttributedSuggestion

An attributed string for the localized suggestion.

Declaration

var localizedAttributedSuggestion: AttributedString { get }

Discussion

The localizedAttributedString provides the suggestion text that the system uses to replace the text in the search bar. The system uses the attributed string to highlight the range of the suggestion string that matches the user query string.

For example, the user types “search”, and the system offers a suggestion for “search suggestion”, where the system marks up “search” using the CSSuggestionHighlightAttributeName. Your app can use the range to add a bold highlight, if desired.

See Also

Setting suggestion attributes