---
title: "renameDocument(at:proposedName:completionHandler:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uidocumentbrowserviewcontroller/renamedocument(at:proposedname:completionhandler:)"
---

# renameDocument(at:proposedName:completionHandler:)

Renames a document at the specified URL.

## Declaration

```swift
func renameDocument(at documentURL: URL, proposedName: String, completionHandler: @escaping (URL?, (any Error)?) -> Void)
```

```swift
func renameDocument(at documentURL: URL, proposedName: String) async throws -> URL
```

## Parameters

- `documentURL`: The URL specifying the location of the document.
- `proposedName`: The proposed new name to rename the document to. If proposedName is already taken, the system might alter the proposed name and confirm the new suggestion with the user. The final name that the system chooses appears in the finalURL parameter of completionHandler.
- `completionHandler`: A completion handler to execute after the renaming operation occurs. The final URL and error information are available in the completion handler.
