Modern Concurrency: Getting Started

Oct 18 2022 · Swift 5.5, iOS 15, Xcode 13.4

Part 2: Asynchronous Sequences

08. Introduction

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: Part 1 Quiz: Asynchronous Code Next episode: 09. Your Second Asynchronous App

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.

Transcript: 08. Introduction

Welcome back to our course Modern Concurrency: Getting Started.

In Part 1, you’ve learned some basic ways to integrate asynchronous code into your apps. You’re getting comfortable calling and writing async functions and iterating over asynchronous sequences.

In Part 2, you’ll implement SuperStorage, a cloud file storage app with three download plans:

  • SuperStorage also uses async/await and AsyncSequence
  • You also learn the async let syntax for grouping asynchronous tasks so they run at the same time.
  • You’ll use the top-level asynchronous Task to call an asynchronous method from a SwiftUI view.
  • You’ll learn a different way to run code on MainActor: @MainActor func addDownload(name: String) { ... }

You’ll get more practice canceling tasks, including a task hierarchy with child tasks.

You’ll use a download stream iterator to process partial downloads. And a local task property to display partial jpeg files. 010-task-local-storage.png

You’ll even integrate a Combine Timer publisher into your app, to show the download duration. 014-timer.png

A Combine publisher can asynchronously emit zero, one or more values. It can, optionally, complete with a success or a failure, just like an async sequence.

Let’s get to work!