Contents

UISearchToken

Search criteria in a search text field, represented by text and an optional icon.

Declaration

@MainActor class UISearchToken

Overview

Use search tokens to help users understand and edit complex search queries in a UISearchTextField. A token acts like a single character in standard text interactions such as deleting, selecting, or dragging. A search token should always have text and may also have an icon.

[Image]

Assign a representedObject to each search token that’s meaningful to your app. By attaching this extra data to the token you can reconstruct the full search query using information available in the search field when, for example, your app starts from state restoration or the user starts a search.

See Using suggested searches with a search controller to learn how to use search tokens.

Topics

Creating a search token

See Also

Search field