<!--
{
  "availability" : [
    "iOS: 11.0.0 -",
    "iPadOS: 11.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.13.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreSpotlight",
  "identifier" : "/documentation/CoreSpotlight/CSSearchableIndexDelegate/data(for:itemIdentifier:typeIdentifier:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Core Spotlight"
    ],
    "preciseIdentifier" : "c:objc(pl)CSSearchableIndexDelegate(im)dataForSearchableIndex:itemIdentifier:typeIdentifier:error:"
  },
  "title" : "data(for:itemIdentifier:typeIdentifier:)"
}
-->

# data(for:itemIdentifier:typeIdentifier:)

Returns the data for the requested item during a drag-and-drop operation.

```
optional func data(for searchableIndex: CSSearchableIndex, itemIdentifier: String, typeIdentifier: String) throws -> Data
```

## Parameters

`searchableIndex`

The index containing the requested searchable item.

`itemIdentifier`

The unique identifier of the searchable item. Use this value to locate
the item in your content.

`typeIdentifier`

The type of data that you must provide. This parameter contains one of
the values from the [`providerDataTypeIdentifiers`](/documentation/CoreSpotlight/CSSearchableItemAttributeSet/providerDataTypeIdentifiers) property
of the item’s attribute set.

## Return Value

A data object with the requested type of data.

## Discussion

If the attributes of your [`CSSearchableItem`](/documentation/CoreSpotlight/CSSearchableItem) contain one or more provider data types, the system
may call this method to request one of those types. Use your implementation of this method to
generate a data object with the requested type of data for the specified item. The system calls
this method on your index’s delegate if your app is running, or the delegate in your Core delegate
app extension if your app isn’t running.

Produce the data as quickly as possible so the app receiving the data can update its interface.
The system calls this method at the end of a drag-and-drop operation, while the receiving app waits.

---

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)