<!--
{
  "availability" : [
    "iOS: 8.0.0 - 14.0.0",
    "iPadOS: 8.0.0 - 14.0.0",
    "macCatalyst: 13.1.0 - 14.0.0",
    "visionOS: 1.0.0 - 1.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIDocumentPickerViewController/init(url:in:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIDocumentPickerViewController(im)initWithURL:inMode:"
  },
  "title" : "init(url:in:)"
}
-->

# init(url:in:)

Initializes and returns a document picker that can export or copy the specified document.

```
init(url: URL, in mode: UIDocumentPickerMode)
```

## Parameters

`url`

The document that the document picker exports or moves.

`mode`

The type of file-transfer operation that the document picker performs. This argument accepts only the [`UIDocumentPickerMode.exportToService`](/documentation/UIKit/UIDocumentPickerMode/exportToService) or [`UIDocumentPickerMode.moveToService`](/documentation/UIKit/UIDocumentPickerMode/moveToService) mode.

## Return Value

Returns an initialized `UIDocumentPickerViewController` object, or `nil` if the object could not be successfully initialized.

## Discussion

In iOS 10 and earlier, this method returns the document picker view controller from the most recently used Document Provider extension. If no valid Document Provider can be found, it defaults back to iCloud Drive.

In iOS 11 and later, it returns the standard browser interface. This interface is the same one used by the [`UIDocumentBrowserViewController`](/documentation/UIKit/UIDocumentBrowserViewController) class.

---

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)