Instance Method

urlProtocol(_:didReceive:cacheStoragePolicy:)

Tells the client that the protocol implementation has created a response object for the request.

Required.

Declaration

func urlProtocol(_ protocol: URLProtocol, didReceive response: URLResponse, cacheStoragePolicy policy: URLCache.StoragePolicy)

Parameters

protocol

The URL protocol object sending the message.

response

The newly available response object.

policy

The cache storage policy for the response.

Discussion

The implementation should use the provided cache storage policy to determine whether to store the response in a cache.

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