Structure

NSURL.BookmarkCreationOptions

Options used when creating bookmark data.

Declaration

struct BookmarkCreationOptions

Overview

When creating a bookmark, use bitwise OR operators to combine the options you want to specify, and provide them to the options parameter of the bookmarkData(options:includingResourceValuesForKeys:relativeTo:) method.

Topics

Initializers

init(rawValue: UInt)

Initializes a new bookmark creation options structure.

Constants

static var preferFileIDResolution: NSURL.BookmarkCreationOptions

Specifies that when a bookmark created with this option is resolved, its embedded file ID should take precedence over other sources of information (file system path, for example) in the event of a conflict.

Deprecated
static var minimalBookmark: NSURL.BookmarkCreationOptions

Specifies that a bookmark created with this option should be created with minimal information.

static var suitableForBookmarkFile: NSURL.BookmarkCreationOptions

Specifies that the bookmark data should include properties required to create Finder alias files.

static var withSecurityScope: NSURL.BookmarkCreationOptions

Specifies that you want to create a security-scoped bookmark that, when resolved, provides a security-scoped URL allowing read/write access to a file-system resource.

static var securityScopeAllowOnlyReadAccess: NSURL.BookmarkCreationOptions

When combined with the withSecurityScope option, specifies that you want to create a security-scoped bookmark that, when resolved, provides a security-scoped URL allowing read-only access to a file-system resource.

Relationships

Conforms To

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 resourceValues(forKeys: [URLResourceKey], fromBookmarkData: Data) -> [URLResourceKey : Any]?

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

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.BookmarkResolutionOptions

Options used when resolving bookmark data.