Initializer

init(contentsOf:)

Provides data backed by the contents of an existing file. The system uses the URL’s filename extension to select an appropriate UTI.

Declaration

convenience init?(contentsOf fileURL: URL!)

Parameters

fileURL

The URL of the file to use for the item provider’s data. The item provider uses the filename extension to determine the UTI for the associated data.

Return Value

An item provider for the specified file or nil if an error occurred.

Discussion

If the system cannot determine a specific UTI based on the filename extension, it assigns the public.data UTI for the file.

See Also

Initializing an Item Provider

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

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

init()

Instantiates an empty item provider to which you can later register a data or file representation.

init(object: NSItemProviderWriting)

Initializes a new item provider, employing a specified object’s type identifiers to specify the data representations eligible to be loaded by the provider.