<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.1.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 3.2.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SiriKit",
  "identifier" : "/documentation/Intents/INSearchForMessagesIntentHandling/handle(intent:completion:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Intents"
    ],
    "preciseIdentifier" : "c:objc(pl)INSearchForMessagesIntentHandling(im)handleSearchForMessages:completion:"
  },
  "title" : "handle(intent:completion:)"
}
-->

# handle(intent:completion:)

Performs the search and returns the results.

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

## 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:

- response: The [`INSearchForMessagesIntentResponse`](/documentation/Intents/INSearchForMessagesIntentResponse) object that contains the status of the request. You also use this object to specify the messages that matched the search parameters. This parameter must not be `nil`.

## 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.

---

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)