modern-swift
Installation
SKILL.md
Modern Swift (6.2+)
Swift 6.2 introduces strict compile-time concurrency checking with async/await, actors, and Sendable constraints that prevent data races at compile time instead of runtime. This is the foundation of safe concurrent Swift.
Overview
Modern Swift replaces older concurrency patterns (completion handlers, DispatchQueue, locks) with compiler-enforced safety. The core principle: if it compiles with strict concurrency enabled, it cannot have data races.
Quick Reference
| Need | Use | NOT |
|---|---|---|
| Async operation | async/await |
Completion handlers |
| Main thread work | @MainActor |
DispatchQueue.main |
| Shared mutable state | actor |
Locks, serial queues |
| Parallel tasks | TaskGroup |
DispatchGroup |
| Thread safety | Sendable |
@unchecked everywhere |