Loads the item’s data and coerces it (as needed) to the specified type.
- iOS 8.0+
- macOS 10.10+
- tvOS 9.0+
- watchOS 2.0+
A string that represents the desired UTI.
A dictionary of keys and values that provide information about the item, such as the size of an image. (See
NSItemfor a key you can use.)
Provider Preferred Image Size Key
A completion handler block to execute with the results. For information about the format of this block, see
Provider .Completion Handler
Call this method when you want to retrieve the item provider’s data. If the item provider object is able to provide data in the requested type, it does so and asynchronously executes your
completion block with the results. The block may be executed on a background thread.
The type information for the first parameter of your
completion block should be set to the class of the expected type. For example, when requesting text data, you might set the type of the first parameter to
NSAttributed. An item provider can perform simple type conversions of the data to the class you specify, such as from
File, or from
UIImage (in iOS) or
NSImage (in macOS). If the data could not be retrieved or coerced to the specified class, an error is passed to the completion block’s.