Configuration

Configuration of a session uses an NSURLSessionConfiguration object. Each session uses a separate configuration object, improving on the global configuration provided in the legacy NSURLConnection. You set properties for connection policies, number of connections, cell usage, cache, credentials, and cookie storage. Use one of the class factories to create a configuration and then modify appropriately.

One welcome new property is an explicit resource timeout in addition to the network timeout. The network timeout (timeoutIntervalForRequest), which existed as a request-level configuration in the past, specifies the timeout for the minimum frequency of incoming bytes of data. The new resource timeout (timeoutIntervalForResource) specifies ...

Get The Core iOS Developer’s Cookbook, Fifth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.