Contents

download(from:delegate:)

Retrieves the contents of a URL and delivers the URL of the saved file asynchronously.

Declaration

func download(from url: URL, delegate: (any URLSessionTaskDelegate)? = nil) async throws -> (URL, URLResponse)

Parameters

  • url:

    The URL to retrieve.

  • delegate:

    A delegate that receives life cycle and authentication challenge callbacks as the transfer progresses.

Return Value

An asynchronously-delivered tuple that contains the location of the downloaded file as a URL, and a URLResponse.

See Also

Performing asynchronous transfers