Contents

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?) -> URL

Mentioned 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