NSURLSession

In the new URL Loading System, sessions maintain the current configuration and serve as the factory for creating tasks. These long-lived objects are intended to be active over multiple network tasks. When creating a session, you can use the class constructors to retrieve the default session or create a custom session. The primary difference is that the default session uses a shared configuration (actually the same shared stack that the legacy NSURLConnection uses), whereas the custom session can be configured with your own customized, private configuration.

NSURLSession also maintains the single delegate that is used for callbacks from the entire stack of session classes, as shown in Figure 13-1 (right). This includes NSURLSessionDelegate ...

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.