← ClaudeAtlas

swift6-concurrencylisted

Swift 6 language mode with complete concurrency checking from the first line of a new Apple-platform project; in-house types treated as `Sendable`; `@preconcurrency import` for lagging deps. Use when setting `swiftLanguageModes` / `swiftSettings` in Package.swift or SWIFT_STRICT_CONCURRENCY / default actor isolation in Xcode build settings, when a new dependency raises Sendable or actor-isolation errors, or when asked "should I turn on strict concurrency". Does NOT own deployment targets → apple-platform-targets; actor / async patterns → apple-skills:swift-concurrency.
wei18/apple-dev-skills · ★ 19 · AI & Automation · score 78
Install: claude install-skill wei18/apple-dev-skills
# Swift 6 / Strict Concurrency ## When to invoke - Starting a new Swift iOS / macOS App project and deciding the language mode. - Writing `Package.swift` and setting `swiftLanguageModes` / `SWIFT_STRICT_CONCURRENCY`. - Adding a new third-party dependency and hitting concurrency warnings / errors. - User asks "how do I configure Swift 6 / complete concurrency / Sendable / actor / `@preconcurrency`". ## Default decisions - **Swift 6 language mode + complete concurrency checking**, applied from the first line of code. - **Default actor isolation is `MainActor`**, following the Xcode 26 App project template (`SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor` + `SWIFT_APPROACHABLE_CONCURRENCY = YES`; the SwiftPM equivalent is `swiftSettings: [.defaultIsolation(MainActor.self)]`, which requires `// swift-tools-version: 6.2`). Under this default an unannotated in-house type never leaves the main actor, so it does **not** need `Sendable` on its own account — `Sendable` is required only for a type that crosses into `nonisolated` code, an actor, or a module with a different isolation default. Declare it explicitly when it does (`struct Foo: Sendable` or `final class Foo: Sendable` — the latter only valid when the class is non-inheritable and every stored property is both `Sendable` and `let`; for classes with mutable state, prefer `actor Foo` or `@unchecked Sendable` with manual synchronisation). - **Layer the isolation default per module** (see `swiftpm-modularization`): keep `MainActor`