Contents

init(item:typeIdentifier:)

Creates an item provider with an object, according to the item provider type coercion policy.

Declaration

init(item: (any NSSecureCoding)?, typeIdentifier: String?)

Parameters

  • item:

    An object containing the data you want to provide. You may specify nil for this parameter and register items and types later.

  • typeIdentifier:

    A string that represents the UTI of the item. If item is not nil, this parameter must not be nil.

Return Value

An item provider for the specified item.

Discussion

Use this method to initialize an item provider for objects in your app. The item provider registers your object with the specified type. Subsequent requests for that same type return the specified item.

See Also

Creating an item provider