I'm basically looking for the reason as to why we have the ability to perform an NSURLSession with a background transfer service when we have the ability to do background threading in iOS.
Is there a big difference?
Yes there's a big difference. These are two different notions of "background".
The background NSURLSessionConfiguration
continues to run the queries for its associated NSURLSession
tasks even if your app is no longer active, i.e. if the user left the app and the the app is suspended (or even if subsequently terminated during the course of the app's normal lifecycle). When the background requests are done, if your app wasn't already running, it will restart your app in the background so that you can quickly process the responses and then suspend/terminate it again when you're done.
On the other hand, submitting something to a background thread performs it in parallel with respect to the main thread (i.e. doesn't block the main thread), but doesn't keep it running after the app is terminated. It's used for performing some slow task in such a way that it will not block the main thread (i.e. minimizing impact on the user interface).
The notion of running standard NSURLSession
requests in background thread is largely redundant because the NSURLSession
always runs asynchronously, anyway. There's little benefit in running it on the background thread. (Sure, you might have the delegate methods and/or completion blocks run on a background queue if they're doing something non-trivial, but the standard NSURLSession
tasks, themselves, already run asynchronously.