The Secret to Intuitively Understanding Swift Concurrency
One core concept that brings clarity to everything
My first brush with Swift concurrency was in 2022, inheriting a small startup codebase as a 1-man-iOS-team. This project had everything: detached tasks in a web-scraping system, async streams listening to repositories, and a central actor that handled authentication.
Each tool I didn’t understand was a paper cut that stung me with imposter syndrome. How had I got so behind just a year after Swift Concurrency released?
Over the subsequent year, like an ASMR mechanic on TikTok, I took each component of concurrency code apart, bit by bit, cleaned them, then put them back, a little more robust. This exercise, alongside my nascent writing habit, compelled me to develop an intuitive understanding of this new-fangled concurrency malarkey.
I was a single-threaded dev marooned in a sea of concurrency. But we don’t all need trial by fire: Getting the hang of one thing will bring you towards an intuitive understanding of Swift Concurrency more than anything else.
I’m not a hack, so I’ll tell you straight up before the paywall: It’s Tasks.
Specifically, being able to reason about using tasks as properties. Building up this skill gives you the power to work with everything Swift Concurrency throws at you.
If you pay me, I’ll be very happy, and I’ll share 5 detailed examples to demonstrate this concept and cement your intuition. If you’re already a Swift Concurrency savant, well, sh*t. Hopefully you like the thumbnail enough to give me money.
Paid subscribers get full access to this article, plus my full Quick Hacks library. You’ll also get all my long-form content 3 weeks before anyone else.
In protest of the Stripe crime family’s transaction fees, I’m running a huge (and real) promotion on annual plans—50% cheaper than the monthly price. Grab it this week to read this article now and lock in savings forever!
Keep reading with a 7-day free trial
Subscribe to Jacob’s Tech Tavern to keep reading this post and get 7 days of free access to the full post archives.