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.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software