Networking with URLSession |

Learn how to use URLSession, Apple's networking API, including when and how to use data, download and upload tasks, with or without a custom session delegate, and how the system manages background sessions. Keep your users' data safe with authentication and App Transport Security, and pick up tips for networking architecture, testing and metrics. Updated for iOS 11 and Swift 4.

This is a companion discussion topic for the original entry at

The first part Getting Started is great but The Data Fetching and Background Sessions part is not clear is just typing but with so much concepts and not too much clear explanation.
Why Ray Wenderlich just not create small projects from scratch for each topic where you can have an easy way to remember and not just typing like you are not fallowing real steps to create something. Also have in mind when you are fallowing tutorials in internet is better with visual helps (maps, drawings …etc )and not just talking. This is an advise for all the tutorials of Ray Wenderlich . also use better the space in the videos not take space with the simulator in the screen you are taking space for the Xcode windows.

We’ll reassess the course when we next update it and we’ll make sure to incorporate your feedback. Thanks for letting us know.

Good tutorial but a little disappointed with the Authentication section around the Authentication Delegates. Would have liked to see more handling of different auth types from the delegates.

Thanks for letting us know. We’ll keep that in mind when we update the course. Cheers!

Hello Brian.

On the Half Tunes background downloading app we copy the save download code and fileprivate trackIndex function from the Search View Controller to the extension Search View Controller: URLSessionDownloadDelegate file. But the code also still remains in Search View Controller. Should this code have been deleted? Or should it exist twice?


@bdmoakley Can you please help with this when you get a chance? Thank you - much appreciated! :]

There is another newer tutorial here:

Brian, once this course gets updated, will there be any work put in to add testing/mocking as in the original version of the course? The description does suggest that testing was going to be a part of this course, but it’s not clear to me that any testing was incorporated or discussed. Thanks.

Probably not. I believe the original course had testing in it, and we ended up cutting it at the last minute. You can find that older testing video over here:

Jessy is currently updating the testing course. I’ll let him know that you are interested in testing and mocking when it comes URLRequests. Thanks for reaching out!