-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Mastering macOS Programming
By :

So, let's take a short look at the URLSession framework itself.
Generally, an app will only need to use one session instance, or in the case of tabbed and document-based applications, one session per tab or document window.
All tasks in any given session share configuration settings, some of which may be overridden by the individual request settings.
In this chapter, we have used two different types of URLSessionTask
, but there are three in total:
URLDataTask
URLDownloadTask
URLStreamTask
Now that you have a reasonably solid grounding in data and download tasks, you should be able to get to grips with stream tasks without too much of a headache.
In addition to the .default
and .background
URLSessionConfiguration
types, we can also declare a session to be of type .ephemeral
:
let ephemeralSession = URLSession(configuration: URLSessionConfiguration.ephemeral)
Such a configuration has no access...