Instance Method インスタンスメソッド

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: 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 非同期転送を実行する