Here’s how you can learn Swift Concurrency in 2 hours 👩🏽‍🎓👨🏻‍🎓

Hi 👋

I hope you’ve had a nice week! On my end I was finally able to chill a bit, now that all the conferences I was scheduled to attend are over 😌

(I might even have gotten myself a new iPhone and a new Watch, but that’s another story 😇)

And since I was at home last week, I was finally able to do a livestream with a new concept that I’ve had in mind for a few weeks!

But before I tell you more about it, I have a big thank you to my sponsor this week: Bitrise 🤖


Advertisement

Join the Mobile DevOps Summit 2023 on Oct 4-5

A two-day, free event with 40+ workshops and sessions brought to you by 50+ industry-leading speakers from eBay, Reddit, AWS and more.

Learn from real-world examples of successful Mobile DevOps implementations!

👉 Check out the speaker list 👈


Sponsors like Bitrise really help me grow my content creation, so if you have time please make sure to have a look at the event they’re organizing: it’s a direct support to my content creation ☺️


During the summer, I shared with you my training courses to learn SwiftUI or Combine in a short amount of time.

Their reception was extremely positive, so I figured: why not do the same for other important skills iOS developers need to master?

I felt that the next logical topic to address was Swift Concurrency, because in the two years since its release, it has really become the standard for asynchronous code in iOS apps.

But this time I added a twist to the formula!

Instead of teaching using only my own code examples, I selected 5 articles from great content creators, and then I went over them and added my own remarks and observations.

This way, you get to learn about Swift Concurrency through several different point of view, and my hope is that it will help you get a very comprehensive picture of the topic!

If you’re curious to watch it, the replay is available on YouTube!

And if you don’t have the time for a 2 hour video and you would prefer to read the 5 blog articles by yourself, I will also share them with you!

Async await in Swift explained with code examples

In this first article, Antoine van der Lee goes covers all the basic of Swift Concurrency: What’s an async function? When do we need to use the await keyword? Where are we allowed to call an async function?

Wrapping existing asynchronous code in async/await in Swift

Once you’ve learned the basics of Swift Concurrency, the question that naturally comes next is: How can I use my legacy completionHandler-based functions with this new approach?

That’s the question Donny Wals answers in this second article 😌

Async let explained: call async functions in parallel

For this third article, we’re back to Antoine’s blog to learn about a very powerful feature of Swift Concurrency: How to define asynchronous constants that allow us to very easily run several async functions in parallel.

What role do Tasks play within Swift’s concurrency system?

In the previous articles, you’ve seen that when you need to call an async function, one of the ways to do it is to wrap the call within a Task.

In this article, John Sundell deeps dive into how a Task works and what are the pitfalls to avoid when using one.

Understanding Swift Task Groups With Example

To finish, this article from Lee Kah Seng covers the last concept you need to grasp in order to get started with Swift Concurrency: TaskGroup.

We’ve seen in a previous article how async let allows us to run a static number of async functions in parallel.

TaskGroup serves a very similar purpose, except that it’s capable of handling a dynamic number of async functions!

Conclusion

That’s the end of my list: once you’ve read these 5 articles you should be familiar with all the main concepts of Swift Concurrency 👌

If you have any feedback on this approach of teaching a new skill through a collection of blog articles, please feel free to share it with me!

And if you have any suggestions of future topics that you would like me to cover, please also feel free to let me know 😌

That’s all for this email, thanks for reading it!

If you’ve enjoyed it, feel free to forward it
to your friends and colleagues 🙌

I wish you an amazing week!

❤️

Previous
Previous

Here are 8 tips to optimize your iOS app 📱

Next
Next

Hidden feature: if and switch