Contents

data(for:itemIdentifier:typeIdentifier:)

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

Declaration

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

See Also

Providing data for an item