Skip to content

Commit 9cd43a0

Browse files
authored
Merge pull request #10435 from kballard/url_resolvingBookmarkData
2 parents ba9cc17 + e66f2b1 commit 9cd43a0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

stdlib/public/SDK/Foundation/URL.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -586,11 +586,20 @@ public struct URL : ReferenceConvertible, Equatable {
586586
}
587587

588588
/// Initializes a URL that refers to a location specified by resolving bookmark data.
589+
@available(swift, obsoleted: 4.2)
589590
public init?(resolvingBookmarkData data: Data, options: BookmarkResolutionOptions = [], relativeTo url: URL? = nil, bookmarkDataIsStale: inout Bool) throws {
590591
var stale : ObjCBool = false
591592
_url = URL._converted(from: try NSURL(resolvingBookmarkData: data, options: options, relativeTo: url, bookmarkDataIsStale: &stale))
592593
bookmarkDataIsStale = stale.boolValue
593594
}
595+
596+
/// Initializes a URL that refers to a location specified by resolving bookmark data.
597+
@available(swift, introduced: 4.2)
598+
public init(resolvingBookmarkData data: Data, options: BookmarkResolutionOptions = [], relativeTo url: URL? = nil, bookmarkDataIsStale: inout Bool) throws {
599+
var stale : ObjCBool = false
600+
_url = URL._converted(from: try NSURL(resolvingBookmarkData: data, options: options, relativeTo: url, bookmarkDataIsStale: &stale))
601+
bookmarkDataIsStale = stale.boolValue
602+
}
594603

595604
/// Creates and initializes an NSURL that refers to the location specified by resolving the alias file at url. If the url argument does not refer to an alias file as defined by the NSURLIsAliasFileKey property, the NSURL returned is the same as url argument. This method fails and returns nil if the url argument is unreachable, or if the original file or directory could not be located or is not reachable, or if the original file or directory is on a volume that could not be located or mounted. The URLBookmarkResolutionWithSecurityScope option is not supported by this method.
596605
@available(macOS 10.10, iOS 8.0, *)

0 commit comments

Comments
 (0)