---
title: "handle(intent:completion:)"
framework: intents
role: symbol
role_heading: Instance Method
path: "intents/insearchformessagesintenthandling/handle(intent:completion:)"
---

# handle(intent:completion:)

Performs the search and returns the results.

## Declaration

```swift
func handle(intent: INSearchForMessagesIntent, completion: @escaping @Sendable (INSearchForMessagesIntentResponse) -> Void)
```

```swift
func handle(intent: INSearchForMessagesIntent) async -> INSearchForMessagesIntentResponse
```

## Parameters

- `intent`: The intent object that contains details about the user’s request. The object’s informatin has already been resolved and confirmed by your handler object.
- `completion`: The handler block to execute with your response. You must execute this handler while implementing this method. This handler has no return value and takes the following parameter:

## Discussion

Discussion Your implementation of this method must perform the search and return the results as part of your response object. If you are unable to perform the search, return a response object whose result code indicates the reason for the failure. note: In watchOS, Siri does not display the search results itself. Instead, it launches your watchOS app to display the search results.
