Concurrency
Dive deep into Swift’s latest concurrency changes, covering async-await, actors, and more.
Default Actor Isolation in Swift 6.2
Default Actor Isolation in Swift 6.2 allows you to run code on the @MainActor by default. This new Swift compiler setting helps improve the approachability of data-race safety, which was set as a goal for the Swift team in their February 2025 vision document. While new projects are set to ...
@concurrent explained with code examples
Swift 6.2 introduced many changes during WWDC 2025, including a new @concurrent attribute we need when working with Swift Concurrency. You might have read that we'll be able to @MainActor all the things now, which also means we need a way out of the @MainActor for asynchronous functions. For the ...
Swift 6.2: A first look at how it’s changing Concurrency
Swift 6.2 is the upcoming release of Apple's native language. It's currently in active development, and as you know from my weekly Swift Evolution updates, many proposals are currently being processed. While many of you usually await a new Xcode release before jumping into new changes, I think knowing what's ...
Observability that's custom-built for mobileDespite our best efforts, sometimes issues slip through the cracks. That's why having an amazing observability tool in your corner is important to keep your app humming. bitdrift gives you on-demand observability that's custom-built for mobile teams: no log limits, no overage fees, and no waiting on your next app release. Learn more.
Swift Concurrency Course: Modern Concurrency & Swift 6
A Swift Concurrency Course that helps you learn all the fundamentals of Swift Concurrency and migrating your projects smoothly to Swift 6 strict concurrency checking. It can be intimidating to start migrating existing projects to Swift 6 and learn all about async/await, sendable, and actors at the same time. A ...
What is Structured Concurrency?
When we talk about Swift Concurrency, we also often mention Structured Concurrency. It's a fundamental part of async/await in Swift and helps us understand how Swift's latest improvements in concurrency work. Before async/await, we wrote our asynchronous methods using closures and Grand Central Dispatch (GCD). This worked well but often ...
Task.sleep() vs. Task.yield(): The differences explained
In Swift Concurrency, we can use Task.sleep() and Task.yield() to let a specific task sleep or yield for a period of time. Both look and behave similarly, but there are a few significant differences to be aware of as Swift developers. Knowing these differences allows you to better understand when ...
Swift 6: What’s New and How to Migrate
Apple announced Swift 6 during WWDC 2024 as a major release of their programming language. It became first available in Xcode 16 and aims to create a fantastic development experience. Many of the latest more prominent features like async/await have been part of the road toward this major version bump ...
MainActor usage in Swift explained to dispatch to the main thread
MainActor is a new attribute introduced in Swift 5.5 as a global actor providing an executor that performs its tasks on the main thread. When building apps, it's essential to perform UI updating tasks on the main thread, which can sometimes be challenging when using several background threads. Using the ...
How to Use URLSession with Async/Await for Network Requests in Swift
URLSession allows you to perform network requests and becomes even more powerful with its async/await APIs. You can request data from a given URL and parse it into a decoded structure before displaying its data in a view. Popular frameworks like Alamofire aim to make it easier to perform requests, ...
Async await in Swift explained with code examples
Async await is part of the new structured concurrency changes that arrived in Swift 5.5 during WWDC 2021. Concurrency in Swift means allowing multiple pieces of code to run at the same time. This is a very simplified description, but it should give you an idea already how important concurrency ...
Concurrency-safe global variables to prevent data races
Concurrency-safe global variables help you prevent data races and allow you to solve strict-concurrency-related warnings. Since you can access global variables from any context, ensuring access is safe by removing mutability or conforming to Sendable is essential. As a developer, you must prevent data races since they can make your ...