Instance Method


Stores a cached URL response for a specified data task.


func storeCachedResponse(_ cachedResponse: CachedURLResponse, for dataTask: URLSessionDataTask)



The cached URL response to store for this data task.


The data task whose response is to be cached.

See Also

Getting and Storing Cached Objects

func cachedResponse(for: URLRequest) -> CachedURLResponse?

Returns the cached URL response in the cache for the specified URL request.

func storeCachedResponse(CachedURLResponse, for: URLRequest)

Stores a cached URL response for a specified request.

func getCachedResponse(for: URLSessionDataTask, completionHandler: (CachedURLResponse?) -> Void)

Gets the cached URL response for a data task, passing it to the provided completion handler.