---
title: "documentPicker(_:didPickDocumentsAt:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uidocumentpickerdelegate/documentpicker(_:didpickdocumentsat:)"
---

# documentPicker(_:didPickDocumentsAt:)

Tells the delegate that the user has selected one or more documents.

## Declaration

```swift
optional func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentsAt urls: [URL])
```

## Parameters

- `controller`: The document picker that called this method.
- `urls`: The URLs of the selected documents.

## Mentioned in

Providing access to directories

## Discussion

Discussion The meaning of the provided URLs varies depending on the document picker’s mode: UIDocumentPickerModeImport The URLs refer to a copy of the selected documents. These documents are temporary files. They remain available only until your application terminates. To keep a permanent copy, move these files to a permanent location inside your sandbox. UIDocumentPickerModeOpen The URLs refer to the selected documents. UIDocumentPickerModeExportToService The URLs refer to new copies of the exported documents at the selected destination. UIDocumentPickerModeMoveToService The URLs refer to the documents’ new locations. The provided URLs are security-scoped, referring to files outside your app’s sandbox. For more about working with external, security-scoped URLs, see Requirements in the Document Picker Programming Guide.

## See Also

### Responding to user actions

- [documentPickerWasCancelled(_:)](uikit/uidocumentpickerdelegate/documentpickerwascancelled(_:).md)
- [documentPicker(_:didPickDocumentAt:)](uikit/uidocumentpickerdelegate/documentpicker(_:didpickdocumentat:).md)
