---
title: "getUserVisibleURL(for:completionHandler:)"
framework: fileprovider
role: symbol
role_heading: Instance Method
path: "fileprovider/nsfileprovidermanager/getuservisibleurl(for:completionhandler:)"
---

# getUserVisibleURL(for:completionHandler:)

Returns the user-visible URL for an item.

## Declaration

```swift
func getUserVisibleURL(for itemIdentifier: NSFileProviderItemIdentifier, completionHandler: @escaping @Sendable (URL?, (any Error)?) -> Void)
```

```swift
func getUserVisibleURL(for itemIdentifier: NSFileProviderItemIdentifier) async throws -> URL
```

## Parameters

- `itemIdentifier`: The item’s identifier.
- `completionHandler`: A block that the system calls after determining the item’s URL. The system passes the following parameters:

## Discussion

Discussion important: You can call this method from synchronous code using a completion handler, as shown on this page, or you can call it as an asynchronous method that has the following declaration: func getUserVisibleURL(for itemIdentifier: NSFileProviderItemIdentifier) async throws -> URL For information about concurrency and asynchronous code in Swift, see Calling Objective-C APIs Asynchronously. Calling this method marks the process so that accessing the URL won’t materialize the item. Instead, any attempt to read or write to an unmaterialized item fails with a EDEADLK POSIX error.

## See Also

### Translating user-visible URLs

- [getIdentifierForUserVisibleFile(at:completionHandler:)](fileprovider/nsfileprovidermanager/getidentifierforuservisiblefile(at:completionhandler:).md)
