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

# handle(intent:completion:)

Handles the media search request.

```
func handle(intent: INSearchForMediaIntent, completion: @escaping @Sendable (INSearchForMediaIntentResponse) -> Void)
```

## Parameters

`intent`

The [`INSearchForMediaIntent`](/documentation/Intents/INSearchForMediaIntent) object that contains details about the user’s request. The Intents app extension confirms the information in this intent before the system calls the [`handle(intent:completion:)`](/documentation/Intents/INSearchForMediaIntentHandling/handle(intent:completion:)) method.

`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 [`INSearchForMediaIntentResponse`](/documentation/Intents/INSearchForMediaIntentResponse) object you create to report the status of the request. This parameter must not be `nil`.

## Discussion

Implement this method to search for the media item.

---

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)