Initializer

init(url:cachePolicy:timeoutInterval:)

Creates and initializes a URL request with the given URL, cache policy, and timeout interval.

Declaration

init(url: URL, cachePolicy: URLRequest.CachePolicy = .useProtocolCachePolicy, timeoutInterval: TimeInterval = 60.0)

Parameters

url

The URL for the request.

cachePolicy

The cache policy for the request. The default is NSURLRequest.CachePolicy.useProtocolCachePolicy.

timeoutInterval

The timeout interval for the request. The default is 60.0. See the commentary for the timeoutInterval for more information on timeout intervals.

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