swift-concurrency
Installation
SKILL.md
Swift Concurrency
Overview
Structured concurrency built on async/await. The compiler enforces isolation (actor, @MainActor) and, under Swift 6 strict concurrency, data-race safety via Sendable. Prefer this over GCD/DispatchQueue for new code.
When to use
- Async iOS work: network, disk, or shared-KMP calls
- Updating UI safely from background work (
@MainActor) - Parallel work (
async let,TaskGroup) - Bridging callback/delegate APIs into
async(withCheckedContinuation) - Compiler errors like "call to main actor-isolated … in a synchronous nonisolated context" or
Sendablewarnings - Consuming Kotlin
suspend/Flowsurfaced as Swiftasync(see kmp-ios-integration)