Initializer

init(url:resolvingAgainstBaseURL:)

Initializes a URL components object by parsing the URL from an NSURL object.

Declaration

init?(url: URL, resolvingAgainstBaseURL resolve: Bool)

Parameters

url

The URL to parse.

resolve

Controls whether the URL should be resolved against its base URL before parsing. If true, and if the url parameter contains a relative URL, the original URL is resolved against its base URL before parsing by calling the absoluteURL method. Otherwise, the string portion is used by itself.

Return Value

Returns the initialized URL components object, or nil if the URL could not be parsed.

See Also

Creating URL Components

init()

Initializes a URL components object with nil for every component.

init?(string: String)

Initializes a URL components object by parsing a URL in string form.