Type Method


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


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



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 bookmarkData(options:includingResourceValuesForKeys:relativeTo:) method for details.


The bookmark data from which you want to retrieve resource values.

Return Value

A dictionary of the requested resource values contained in bookmarkData.

See Also

Working with Bookmark Data

class func bookmarkData(withContentsOf: URL) -> Data

Initializes and returns bookmark data derived from an alias file pointed to by a specified URL.

class func writeBookmarkData(Data, to: URL, options: NSURL.BookmarkFileCreationOptions)

Creates an alias file on disk at a specified location with specified bookmark data.

func startAccessingSecurityScopedResource() -> Bool

In an app that has adopted App Sandbox, makes the resource pointed to by a security-scoped URL available to the app.

func stopAccessingSecurityScopedResource()

In an app that adopts App Sandbox, revokes access to the resource pointed to by a security-scoped URL.

typealias NSURL.BookmarkFileCreationOptions

Options used when creating file bookmark data

struct NSURL.BookmarkCreationOptions

Options used when creating bookmark data.

struct NSURL.BookmarkResolutionOptions

Options used when resolving bookmark data.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software