bookmarkData(withContentsOf:)
Initializes and returns bookmark data derived from an alias file pointed to by a specified URL.
Declaration
class func bookmarkData(withContentsOf bookmarkFileURL: URL) throws -> DataParameters
- bookmarkFileURL:
The URL that points to a file containing bookmark data.
Return Value
The bookmark data for the alias file.
Discussion
This method doesn’t check to see if bookmarkFileURL points to an alias file. This allows this method to work with any file containing bookmark data. If bookmarkFileURL refers to a file which does not contain bookmark data or to a non-file object, such as a directory or symbolic link, this method returns nil produces an error.
This method returns nil if bookmark data cannot be created.
See Also
Working with Bookmark Data
bookmarkData(options:includingResourceValuesForKeys:relativeTo:)resourceValues(forKeys:fromBookmarkData:)writeBookmarkData(_:to:options:)startAccessingSecurityScopedResource()stopAccessingSecurityScopedResource()NSURL.BookmarkFileCreationOptionsNSURL.BookmarkCreationOptionsNSURL.BookmarkResolutionOptions