Initializer

init(response:data:)

Creates a cached URL response instance.

Declaration

init(response: URLResponse, data: Data)

Parameters

response

The response to cache.

data

The data to cache.

Return Value

A cached URL response object, containing the response and data.

Discussion

The cache storage policy is set to the default, URLCache.StoragePolicy.allowed, and the user info dictionary is set to nil.

See Also

Creating a Cached URL Response

init(response: URLResponse, data: Data, userInfo: [AnyHashable : Any]?, storagePolicy: URLCache.StoragePolicy)

Creates a cached URL response instance with a given server response, data, user-info dictionary, and storage policy.