fileURL(withPath:relativeTo:)
Initializes and returns a newly created file NSURL referencing the local file or directory at path, relative to a base URL.
Declaration
class func fileURL(withPath path: String, relativeTo baseURL: URL?) -> URLMentioned in
Discussion
Better to use fileURLWithPath:isDirectory:relativeToURL: if you know if the path is a directory vs non-directory, as it saves an I/O.
See Also
Creating a URL object
init(string:)init(string:encodingInvalidCharacters:)init(string:relativeTo:)fileURL(withPath:isDirectory:)init(fileURLWithPath:isDirectory:)init(fileURLWithPath:relativeTo:)fileURL(withPath:isDirectory:relativeTo:)init(fileURLWithPath:isDirectory:relativeTo:)fileURL(withPath:)init(fileURLWithPath:)fileURL(withPathComponents:)init(resolvingAliasFileAt:options:)init(resolvingBookmarkData:options:relativeTo:bookmarkDataIsStale:)fileURL(withFileSystemRepresentation:isDirectory:relativeTo:)getFileSystemRepresentation(_:maxLength:)