init(dataRepresentation:relativeTo:isAbsolute:)
Initializes a newly created URL using the contents of the given data, relative to a base URL.
Declaration
init?(dataRepresentation: Data, relativeTo base: URL?, isAbsolute: Bool = false)Discussion
If the data representation isn’t a legal URL string as ASCII bytes, the URL object may not behave as expected. This initializer returns nil if it can’t form a valid URL from the provided string.