init(url:resolvingAgainstBaseURL:)
Creates 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
urlparameter 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.