---
title: "init(resolvingBookmarkData:options:relativeTo:bookmarkDataIsStale:)"
framework: foundation
role: symbol
role_heading: Initializer
path: "foundation/url/init(resolvingbookmarkdata:options:relativeto:bookmarkdataisstale:)-3ic6f"
---

# init(resolvingBookmarkData:options:relativeTo:bookmarkDataIsStale:)

Creates a URL that refers to a location specified by resolving bookmark data.

## Declaration

```swift
init(resolvingBookmarkData data: Data, options: URL.BookmarkResolutionOptions = [], relativeTo url: URL? = nil, bookmarkDataIsStale: inout Bool) throws
```

## Parameters

- `data`: The bookmark data used to construct a URL.
- `options`: Options taken into account when resolving the bookmark data. To resolve a security-scoped bookmark to support App Sandbox, include the doc://com.apple.foundation/documentation/Foundation/NSURL/BookmarkResolutionOptions/withSecurityScope option.
- `url`: The base URL that the bookmark data is relative to. If you’re resolving a security-scoped bookmark to obtain a security-scoped URL, use this parameter as follows: To resolve an app-scoped bookmark, use a value of nil. To resolve a document-scoped bookmark, use the absolute path (despite this parameter’s name) to the document from which you retrieved the bookmark. App Sandbox doesn’t restrict which URL values you can pass to this parameter.
- `bookmarkDataIsStale`: On return, if true, the bookmark data is stale. Your app should create a new bookmark using the returned URL and use it in place of any stored copies of the existing bookmark.

## See Also

### Creating a URL from a string

- [init(string:)](foundation/url/init(string:).md)
- [init(string:encodingInvalidCharacters:)](foundation/url/init(string:encodinginvalidcharacters:).md)
- [init(string:relativeTo:)](foundation/url/init(string:relativeto:).md)
- [init(resolvingBookmarkData:options:relativeTo:bookmarkDataIsStale:)](foundation/url/init(resolvingbookmarkdata:options:relativeto:bookmarkdataisstale:)-97e6x.md)
