Protocol

NSItemProviderWriting

The protocol you implement on a class to allow an item provider to retrieve data from an instance of the class.

Overview

A source app uses an object that conforms to this protocol to initialize an item provider for a copied or dragged item.

Topics

Loading Data

func loadData(withTypeIdentifier: String, forItemProviderCompletionHandler: (Data?, Error?) -> Void)

Loads data of a particular type, identified by the given UTI.

Required.

Getting the Writable Type Identifiers

static var writableTypeIdentifiersForItemProvider: [String]

An array of UTI strings representing the types of data that can be loaded for an item provider.

Required.

var writableTypeIdentifiersForItemProvider: [String]

An array of UTI strings representing the types of data that can be loaded for an item provider.

Getting the Representation Visibility Specification

The representation visibility specifications control which categories of processes can see the item provider.

static func itemProviderVisibilityForRepresentation(withTypeIdentifier: String)

Asks the item provider for the default representation visibility specification for the given UTI.

func itemProviderVisibilityForRepresentation(withTypeIdentifier: String)

Asks the item provider for the representation visibility specification for the given UTI.

See Also

Item Providers

class NSItemProvider

An item provider for conveying data or a file between processes during drag and drop or copy/paste activities, or from a host app to an app extension.

protocol NSItemProviderReading

The protocol you implement on a class to allow an item provider to create an instance of the class.