init(response:data:userInfo:storagePolicy:)
Creates a cached URL response with a given server response, data, user-info dictionary, and storage policy.
Declaration
init(response: URLResponse, data: Data, userInfo: [AnyHashable : Any]? = nil, storagePolicy: URLCache.StoragePolicy)Parameters
- response:
The response to cache.
- data:
The data to cache.
- userInfo:
An optional dictionary of user information. May be
nil. - storagePolicy:
The storage policy for the cached response.
Return Value
A cached URL response object, containing the response and data.