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

# init(url:in:)

Initializes and returns a document menu to export or move the given document.

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

## Parameters

`url`

The document to be exported or moved.

`mode`

The type of file-transfer operation that the document picker performs. This argument accepts only the UIDocumentPickerModeExportToService or UIDocumentPickerModeMoveToService mode.

## Return Value

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

## Discussion

The resulting document menu displays all the document pickers appropriate for the given mode.

---

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)