After reading the book I can’t comprehend what NSURLSession is used for still.
Can someone use simple plain English to describe this class.
“The purpose of the NSURLSession is a bit hazier. NSURLSession’s job is to create tasks of a similar nature. For example, if your application had a set of requests that all required the same header fields, you could configure the NSURLSession with these additional header fields. Similarly, if a set of requests should not connect over cellular networks, then an NSURLSession could be configured to not allow cellular access. These shared behaviors and attributes are then configured on the tasks that the session creates.”
Excerpt From: Keur, Christian. “iOS Programming: The Big Nerd Ranch Guide (4th Edition) (Big Nerd Ranch Guides).” iBooks.
This paragraphs uses some example that I’ve not seen before to describe NSURLSession’s job. (PS. I don’t understand what they meant by header fields and cellular access, I’m not a native English speaker. I presume cellular access to have something to do with the phones )
Let me know if I’m wrong, the job of NSURLSession is to use it as a place to complete task where we can set its properties whether to allow cellular access or not. And if we allow cellular access we use this NSURLSession , if we don’t we create another NSURLSession and disallow cellular access and use it instead.