What’s the difference between passing false and true to ‘resolvingAgainstBaseURL’ when initialize a NSURLComponents instance?

It makes only a difference if you create the URL components from an NSURL which was created relative to another NSURL: let baseURL = NSURL(string: “http://server/foo/”)! let url = NSURL(string: “bar/file.html”, relativeToURL: baseURL)! print(url.absoluteString) // “http://server/foo/bar/file.html” With resolvingAgainstBaseURL == false, the URL components represent only the relative part of the URL: let comp1 = NSURLComponents(URL: … Read more