<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSItemProvider/init(contentsOf:contentType:openInPlace:coordinated:visibility:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "s:So14NSItemProviderC22UniformTypeIdentifiersE10contentsOf07contentD011openInPlace11coordinated10visibilityAB10Foundation3URLV_AC6UTTypeVSgS2bSo0aB24RepresentationVisibilityVtcfc"
  },
  "title" : "init(contentsOf:contentType:openInPlace:coordinated:visibility:)"
}
-->

# init(contentsOf:contentType:openInPlace:coordinated:visibility:)

Provides data-backed content from an existing file with the specified parameters.

```
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`

`true` if the system opens the file in place.

`coordinated`

`true` if the returned file must be accessed using [`NSFileCoordinator`](/documentation/Foundation/NSFileCoordinator).

`visibility`

The [`NSItemProviderRepresentationVisibility`](/documentation/Foundation/NSItemProviderRepresentationVisibility) setting the system uses to identify which processes can see this content.

## Discussion

If [`openInPlace`](/documentation/Foundation/NSItemProviderFileOptions/openInPlace) is set to `false`, the system copies the file provided before the load handler returns.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)