← ClaudeAtlas

dhpk-swift-languagelisted

Swift language guidance for concurrency, optionals, value/reference design, property wrappers, and errors across Swift 5.10/6. Use for .swift implementation or review. Not for SwiftUI composition or iOS SDK APIs. Output: compatibility and verification decisions.
hmj1026/dhpk · ★ 2 · Web & Frontend · score 71
Install: claude install-skill hmj1026/dhpk
# Swift language — baseline This is the shared language floor for the iOS suite. `swiftui`, `dhpk-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`