---
title: "resourceValues(forKeys:fromBookmarkData:)"
framework: foundation
role: symbol
role_heading: Type Method
path: "foundation/nsurl/resourcevalues(forkeys:frombookmarkdata:)"
---

# resourceValues(forKeys:fromBookmarkData:)

Returns the resource values for properties identified by a specified array of keys contained in specified bookmark data.

## Declaration

```swift
class func resourceValues(forKeys keys: [URLResourceKey], fromBookmarkData bookmarkData: Data) -> [URLResourceKey : Any]?
```

## Parameters

- `keys`: An array of names of URL resource properties. In addition to the standard, system-defined resource properties, you can also request any custom properties that you provided when you created the bookmark. See the doc://com.apple.foundation/documentation/Foundation/NSURL/bookmarkData(options:includingResourceValuesForKeys:relativeTo:) method for details.
- `bookmarkData`: The bookmark data from which you want to retrieve resource values.

## Return Value

Return Value A dictionary of the requested resource values contained in bookmarkData.

## See Also

### Related Documentation

- [URLResourceKey](foundation/urlresourcekey.md)

### Working with Bookmark Data

- [bookmarkData(withContentsOf:)](foundation/nsurl/bookmarkdata(withcontentsof:).md)
- [bookmarkData(options:includingResourceValuesForKeys:relativeTo:)](foundation/nsurl/bookmarkdata(options:includingresourcevaluesforkeys:relativeto:).md)
- [writeBookmarkData(_:to:options:)](foundation/nsurl/writebookmarkdata(_:to:options:).md)
- [startAccessingSecurityScopedResource()](foundation/nsurl/startaccessingsecurityscopedresource().md)
- [stopAccessingSecurityScopedResource()](foundation/nsurl/stopaccessingsecurityscopedresource().md)
- [NSURL.BookmarkFileCreationOptions](foundation/nsurl/bookmarkfilecreationoptions.md)
- [NSURL.BookmarkCreationOptions](foundation/nsurl/bookmarkcreationoptions.md)
- [NSURL.BookmarkResolutionOptions](foundation/nsurl/bookmarkresolutionoptions.md)
