<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UISearchTextFieldDelegate",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UISearchTextFieldDelegate"
  },
  "title" : "UISearchTextFieldDelegate"
}
-->

# UISearchTextFieldDelegate

The interface for the delegate of a search field.

```
@MainActor protocol UISearchTextFieldDelegate : UITextFieldDelegate
```

## Overview

A search field asks its delegate for an <doc://com.apple.documentation/documentation/Foundation/NSItemProvider> when the user starts to copy or move a token. To support these interactions, set the search field’s [`delegate`](/documentation/UIKit/UITextField/delegate) to an instance of [`UISearchTextFieldDelegate`](/documentation/UIKit/UISearchTextFieldDelegate) that implements [`searchTextField(_:itemProviderForCopying:)`](/documentation/UIKit/UISearchTextFieldDelegate/searchTextField(_:itemProviderForCopying:)) and set the search field’s [`allowsCopyingTokens`](/documentation/UIKit/UISearchTextField/allowsCopyingTokens) property to <doc://com.apple.documentation/documentation/Swift/true>.

The search field’s [`pasteDelegate`](/documentation/UIKit/UITextPasteConfigurationSupporting/pasteDelegate) handles pasting and dropping tokens as well as text.

## Topics

### Providing information to copy and drag

[`searchTextField(_:itemProviderForCopying:)`](/documentation/UIKit/UISearchTextFieldDelegate/searchTextField(_:itemProviderForCopying:))

Asks the delegate for an object that can provide a token when the copied token is pasted.

### Responding to search suggestion selections

[`searchTextField(_:didSelect:)`](/documentation/UIKit/UISearchTextFieldDelegate/searchTextField(_:didSelect:))

Tells the delegate when a person selects a search suggestion in the search text field.



---

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)