init(contentsOf:contentType:openInPlace:coordinated:visibility:)
Provides data-backed content from an existing file with the specified parameters.
Declaration
convenience init(contentsOf fileURL: URL, contentType: UTType?, openInPlace: Bool = false, coordinated: Bool = false, visibility: NSItemProviderRepresentationVisibility = .all)Parameters
- fileURL:
The URL of the file to use for the item provider’s data.
- contentType:
The content type of the specified file.
- openInPlace:
trueif the system opens the file in place. - coordinated:
trueif the returned file must be accessed using Nsfilecoordinator. - visibility:
The Nsitemproviderrepresentationvisibility setting the system uses to identify which processes can see this content.
Discussion
If openInPlace is set to false, the system copies the file provided before the load handler returns.