Beginning Networking with URLSession

Sep 13 2022 · Swift 5.6, iOS 15, Xcode 13.4.1

Part 1: Introduction to URLSession & Concurrency

08. Conclusion

Episode complete

Play next episode

Next
About this episode

Leave a rating/review

See forum comments
Cinema mode Mark complete Download course materials
Previous episode: 07. Challenge: Fetch Data Over the Network Next episode: 09. Introduction

Get immediate access to this and 4,000+ other videos and books.

Take your career further with a Kodeco Personal Plan. With unlimited access to over 40+ books and 4,000+ professional videos in a single subscription, it's simply the best investment you can make in your development career.

Learn more Already a subscriber? Sign in.

Notes: 08. Conclusion

URLSession - Apple Developer

Transcript: 08. Conclusion

At this point you made it through the first part, congrats! We started this part by giving an overview of concurrency.

Concurrency is incredibly important at providing a responsive experience to the user. It allows the user to do other things while you’re fetching data in the background and Swift’s concurrency features simplify this for you.

You were also introduced to URLSession and learned that a session is composed of many different components. There’s a configuration object that allows you to customize how the session works. There are also data tasks that actually do the fetch operation. The session manages both the configuration and task.

Sessions work best when using multiple tasks so you should aim to group your tasks together around one URLSession versus creating a new URLSession for each task.

You can also quickly access URLSessions by using the shared property. This is great for simple requests, but it doesn’t provide any means to configure the session.

You’re just getting started, however. In part 2 of the course, you will: dive deeper into data transfers; learn how to handle errors in requests; show download progress; group requests; pause, resume, and cancel downloads.