What problem does it solve?
This Skill addresses implicit background offloading and resulting data races in Swift async code by describing how to adopt Swift 6.2's single-thread-by-default model and avoid actor isolation pitfalls so your UI and shared state remain safe and deterministic.
Core Features & Use Cases
- Single-thread-by-default guidance: explains how async calls remain on the calling actor in Swift 6.2 to prevent accidental offloading.
- Isolated conformances and MainActor patterns: shows how MainActor types can safely conform to non-isolated protocols and how to protect global/static state.
- Explicit background offloading with @concurrent: details when to mark types nonisolated, annotate functions with @concurrent, and apply await at call sites for CPU-bound work.
- Migration checklist and settings: stepwise instructions for enabling MainActor inference in Xcode and SwiftPM, using migration tooling, and validating changes with tests and profiling.
- Use cases: migrating legacy Swift projects, designing MainActor-centric app architectures, and offloading image processing or heavy computations safely.
Quick Start
Migrate a module to Swift 6.2 by enabling MainActor inference in your build settings, audit actor-isolated globals and protocol conformances, profile hot paths, and add @concurrent to CPU-bound functions where needed.