<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.1.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UISearchToken",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UISearchToken"
  },
  "title" : "UISearchToken"
}
-->

# UISearchToken

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

```
@MainActor class UISearchToken
```

## Overview

Use search tokens to help users understand and edit complex search queries in a [`UISearchTextField`](/documentation/UIKit/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.

![Screenshot of a search window with a red circle and the words “Red Flowers Carnation”. The red dot and “Red Flowers” are in a gray box labeled as a UISearchToken and “Carnation” is labeled as text. ](images/com.apple.uikit/media-3539104@2x.png)

Assign a [`representedObject`](/documentation/UIKit/UISearchToken/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](/documentation/UIKit/using-suggested-searches-with-a-search-controller) to learn how to use search tokens.

## Topics

### Creating a search token

[`init(icon:text:)`](/documentation/UIKit/UISearchToken/init(icon:text:))

Creates a search token with the specified text and icon (if any).

[`representedObject`](/documentation/UIKit/UISearchToken/representedObject)

The object represented by the search token.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)