Initializer

init(configuration:)

Creates a session with the specified session configuration.

Declaration

init(configuration: URLSessionConfiguration)

Parameters

configuration

A configuration object that specifies certain behaviors, such as caching policies, timeouts, proxies, pipelining, TLS versions to support, cookie policies, credential storage, and so on.

See URLSessionConfiguration for more information.

Discussion

Calling this method is equivalent to calling init(configuration:delegate:delegateQueue:) with a nil delegate and queue.

See Also

Creating a Session

init(configuration: URLSessionConfiguration, delegate: URLSessionDelegate?, delegateQueue: OperationQueue?)

Creates a session with the specified session configuration, delegate, and operation queue.

class var shared: URLSession

Returns a shared singleton session object.