← ClaudeAtlas

swift-languagelisted

Swift 6 language baseline with Swift 5.10 / iOS 17 compatibility notes — strict concurrency (Sendable, actors, @MainActor, data-race safety), async/await + structured concurrency (TaskGroup, cancellation, continuations), optionals discipline (no force-unwrap outside tests), value-vs-reference decision rules, property-wrapper authoring, error handling (typed throws / Result). Use when writing or reviewing any .swift file, deciding actor vs @MainActor vs Sendable struct, unwrapping optionals, choosing struct vs class, or porting Swift 5.10 code onto the Swift 6 language mode. Not for SwiftUI view composition (see swiftui module) or iOS SDK frameworks (see ios-platform module).
hmj1026/dhpk · ★ 1 · Data & Documents · score 74
Install: claude install-skill hmj1026/dhpk
# Swift language — baseline This is the shared language floor for the iOS suite. `swiftui`, `ios-platform`, `swift-testing`, and `xcode-tooling` all `requires: swift`. Load the references on demand: - `references/concurrency.md` — Sendable / actors / @MainActor / async-await, Swift 6 vs 5.10 mode. - `references/approachable-concurrency.md` — Swift 6.2+ (Xcode 26+) defaults: async stays on the caller, `@concurrent` opt-in offload, isolated conformances, MainActor default inference. - `references/value-vs-reference.md` — struct vs class vs actor decision table; copy-on-write. - `references/error-handling.md` — `throws` / typed throws / `Result` / `do-catch` selection. - `references/swift5-compat-notes.md` — the iOS 17 / Swift 5.10 floor and what differs from Swift 6. > SSOT for the project's language mode is the Xcode build setting > `SWIFT_VERSION` + per-target `SWIFT_STRICT_CONCURRENCY`. Read those before > assuming Swift 6 enforcement is on. --- ## Core rules 1. **No force operators in non-test code.** `!` (force-unwrap), `try!`, `as!`, and implicitly-unwrapped optionals (`var x: T!`) are banned outside tests and `@IBOutlet`/lifecycle-guaranteed properties. Use `guard let … else` (early exit), `if let`, `??`, `try?`, or `as?` + `guard`. 2. **Concurrency is type-checked, not hoped.** Shared mutable state that crosses an isolation boundary must be `Sendable` (a value type of Sendable members, an `actor`, or an explicitly-audited `@unchecked Sendable` with