<!--
{
  "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/INSearchForMediaIntent/init(mediaItems:mediaSearch:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Intents"
    ],
    "preciseIdentifier" : "c:objc(cs)INSearchForMediaIntent(im)initWithMediaItems:mediaSearch:"
  },
  "title" : "init(mediaItems:mediaSearch:)"
}
-->

# init(mediaItems:mediaSearch:)

Creates an intent that describes the media items for which to search and where to search for them.

```
init(mediaItems: [INMediaItem]?, mediaSearch: INMediaSearch?)
```

## Parameters

`mediaItems`

The media content, such as a song or TV show, that the user is playing. When donating the intent, the system uses only the first item in the array, ignoring the other media items in the array.

`mediaSearch`

The location in which to search when looking for a media item.

## Return Value

An initialized intent object or nil if the object could not be created.

## Discussion

The [`INSearchForMediaIntent`](/documentation/Intents/INSearchForMediaIntent) object should include information about the media that accurately represents the content and where to find it.

---

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)