
Explore concurrency in swift with async/await and actors, mastering grand central dispatch, the mvvm design pattern, continuation, task groups, async sequence, and unstructured tasks for robust iOS apps.
Ensure you have Xcode 13 or newer (latest beta or release) and a solid Swift and SwiftUI background to explore async/await, actors, and concurrency in this intermediate Swift course.
Download the starter project from resources to begin exploring async and await, or grab the final lecture resource to review the results; every lecture provides exercise files for Swift.
Identify upcoming Swift concurrency changes for iOS 15, including replacing the async keyword with task and replacing async detach with task.detached, with deprecation warnings guiding safe updates.
Understand concurrency and how avoiding main thread work by dispatching downloads to a background queue keeps the UI responsive and updates happen on the main thread.
Explore grand central dispatch basics, including the main UI thread, serial and concurrent queues, and quality of service levels, with guidance on updating the UI from the main thread.
Build a basic SwiftUI app that fetches the current time from a custom server using async/await with URLSession, and explore unstructured tasks and the task or async modifier.
Explore the starter project and implement async/await with URLSession to fetch current date from a simple api, decoding the date and appending it to a list on refresh.
Implement a private getDate async function that fetches the current date from a glitch-hosted URL via URLSession, decodes JSON to a current date model, and throws on failure.
Explore calling the async getDate function with await to populate a state array of dates, including optional unwrapping with guard and error handling with do-catch.
Use the task modifier to call async fetches, populate dates, and display them in a list, then append new dates by tapping refresh to fetch from the server.
Learn to refresh dates by calling an async function from synchronous button code using an async closure, awaiting populate dates to append new server dates from a glitch server.
Explore design patterns as best practices for solving problems, emphasizing relationships between classes and objects, and recognize that patterns are programming independent, flexible, reusable, maintainable, and relate to MVVM.
Explore mvvm, which uses model, view, and view model, with the view model as the middleman that displays model data on the view and keeps logic encapsulated for maintainable apps.
Adopt mvvm architecture to handle web api fetches and posts by routing data through the view model to a web service, avoiding direct view-to-service calls and ensuring clean separation.
Explore how a SwiftUI view uses MVVM to request data from a view model, which calls a HTTP client to cloud web API, converting model into view model for display.
Implement the starter project for the dates application using the MVVM pattern, building on the async/await concepts, and download the resource file to complete the exercise.
Create date list view model as an observable object, exposing a date view model with date and id, and fetch dates via an async web service using a main actor.
Learn to display dates on screen using the MVVM pattern with async/await, fetch current time from a web service, and refresh data while isolating the date model.
Explore how to convert custom completion-handler code to async/await using continuations, exposing your own Swift code as async functions alongside Apple APIs that already use async/await.
Explore continuation in Swift to convert callback-based functions to async/await by exposing a legacy get post function, using await as the suspension point, and resuming with continuation.
Convert a callback-based get posts function into async/await using continuation. Build a Post model and NetworkError, decode JSON with URLSession using a Result type, and expose results through the continuation.
Convert a callback-based getPost function to async/await in Swift using the continuation API. Implement a proxy getPosts function with with checked continuation, resume with posts, or throw errors.
Build a news application using async/await in Swift, fetching sources and articles via URL session and News API, and expose functions with a continuation API while using the main actor.
Learn to apply async and await in a master-detail news app built with MVVM, fetching sources and articles from a JSON news API and loading images with async image view.
Learn to convert fetch sources to async and await with URLSession data, JSON decoding, and view model mapping, and use a SwiftUI task closure. Explore continuation for fetchNews.
Learn how the main actor replaces dispatch to run updates on the main thread in news article list view model and news source list view model using async/await.
Wrap synchronous calls in an async closure to await async functions, enabling refresh button actions to call get sources with await and explore async/await in Swift.
Wrap a third-party fetch news function with a checked throwing continuation to expose a custom async throws method you can await and resume on success or fail.
Learn to implement async and await with concurrent tasks to fetch credit scores from Equifax and Experian using a user ID, then calculate the APR in Swift.
Use async let to run two concurrent tasks per user ID in a loop by calling get APR and awaiting results; each ID spawns Equifax and Experian tasks.
Learn to cancel and handle errors in Swift concurrency by throwing invalid ID errors, checking cancellation with task.checkCancellation and task.isCancelled, catching errors, and reporting unprocessed items before exploring task groups.
Use throwing task groups to run a dynamic number of concurrent tasks with async/await, returning (id, apr) pairs and building the results dictionary while avoiding data races.
explains unstructured tasks in Swift concurrency, showing how to call an async function from a non-async context using task.init, and notes async deprecation in favor of task.init.
Detached tasks do not inherit a parent context and are generally discouraged in favor of structured concurrency with async and await.
Fetch a random image and code in an MVVM Swift app, using a web service with async/await and async let to concurrently download data and decode JSON into models.
Implements the random image list view model with the main actor and async get random images, awaiting results and mapping them to random image view models for UI display.
Display random images and quotes in a SwiftUI app by loading from two APIs, using a random image list view model, and leveraging task groups for concurrent tasks.
Leverage task groups to run concurrent tasks in Swift, wrapping a loop that fetches random images and quotes. Return id and image tuples and process results with an async sequence.
Explore progressive downloads by displaying each image as soon as it finishes downloading, using async/await and a task group to fetch images concurrently and update the UI progressively.
Wrap the refresh action in a task closure to perform an unstructured async operation that fetches new random images, then clear the list and display the latest progressive downloads.
Explore the endpoint's async sequence and process each line as it arrives with try await in a for loop, streaming data via unstructured concurrency in an async task.
Discover built-in iOS async sequences, including file handle, URL lines, and notification center, and learn to read bytes, stream data, and convert callbacks with async/await.
Concurrency allows multiple tasks to run at the same time. Understanding concurrency is an important part of iOS app development. When used correctly, it can create a pleasant user experience and can even avoid crashing your app. In this course, you will learn about the new concurrency features available in Swift using Async/Await and Actors.
Async/Await and Actors are the future direction of concurrency in Swift and this course will teach you the concepts and practical uses of these modern features. After completing this course, you will be comfortable to add these new features in your applications.
Requirements:
Xcode 13 or above
Knowledge of Swift language is recommended
macOS Catalina or above
Knowledge of SwiftUI is recommended
Passion for development and an open mind
This is not a beginners course
Let’s check out the contents discussed in the course:
Understanding Concurrent Programming
Getting Started with Async & Await (Dates App)
Understanding MVVM Design Pattern
Dates App Using MVVM
Exposing your Functions as Async/Await Using Continuation
Project: News App
Understanding Structured Concurrency in Swift
Project: Random Images and Quotes
AsyncSequence
Actors
Who this course if for:
Students who want to learn about new concurrency features in Swift language.
Anyone interested in learning modern concurrency programming techniques using Swift.
Students who want to learn the new Async/Await and Actor features.
Don’t take my word for it, take a look at some of the amazing reviews for my other courses.
Great course, Azam skips the basic stuff yet does CLEARLY explain the important concepts that most courses miss or fail to provide clear details about. It looks like he keeps the course up to date as well, either by adding updated lessons or notes explaining changes in the swift framework in the notes.
This course was above my expectations indeed. Very valuable, and thank you Azam.
The last 6 months I've followed many courses, but this Section by far has helped my understanding of ObseravableObject, @State etc.Im sure I'm going to run into some problems putting this into practice, but at least I have this course to come back to reference.
As every course by Azam is awesome, full of information and Great explanations and examples, simply amazing. Azam is such a Great Teacher. If you really want to learn and make good use of your money, he is the right Choice.