Structure

NSURL.BookmarkCreationOptions

Options used when creating bookmark data.

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.

Version-Notes

Security-scoped bookmarks are not available in versions of macOS prior to OS X v10.7.3.

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. This produces a smaller bookmark that can be resolved in fewer ways.

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; for use in an app that adopts App Sandbox. For more information, see App Sandbox Design Guide. Note that this flag cannot be used in conjunction with either NSURLBookmarkCreationMinimalBookmark or NSURLBookmarkCreationSuitableForBookmarkFile.

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; for use in an app that adopts App Sandbox. For more information, see App Sandbox Design Guide.

Relationships

Conforms To

See Also

Creating Bookmarks

func bookmarkData(options: URL.BookmarkCreationOptions, includingResourceValuesForKeys: Set<URLResourceKey>?, relativeTo: URL?)

Returns bookmark data for the URL, created with specified options and resource values.

static func bookmarkData(withContentsOf: URL)

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

static func writeBookmarkData(Data, to: URL)

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

static func resourceValues(forKeys: Set<URLResourceKey>, fromBookmarkData: Data)

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

typealias URL.BookmarkCreationOptions

An alias for bookmark creation options.