swift-languagelisted
Install: claude install-skill dpearson2699/swift-ios-skills
# Swift Language Patterns
Core Swift language features and modern syntax patterns targeting Swift 6.3. Covers language constructs, type system features, Codable,
string and collection APIs, formatting, C interop (`@c`), module disambiguation (`ModuleName::symbol`), and performance attributes (`@specialized`, `@inline(always)`). For concurrency (actors, async/await,
Sendable), see the `swift-concurrency` skill. For SwiftUI views and state
management, see `swiftui-patterns`.
## Contents
- [If/Switch Expressions](#ifswitch-expressions)
- [Typed Throws](#typed-throws)
- [Result Builders](#result-builders)
- [Property Wrappers](#property-wrappers)
- [Opaque and Existential Types](#opaque-and-existential-types)
- [Guard Patterns](#guard-patterns)
- [Never Type](#never-type)
- [Regex Builders](#regex-builders)
- [Codable Best Practices](#codable-best-practices)
- [Modern Collection APIs](#modern-collection-apis)
- [FormatStyle](#formatstyle)
- [String Interpolation](#string-interpolation)
- [Common Mistakes](#common-mistakes)
- [Review Checklist](#review-checklist)
- [References](#references)
## If/Switch Expressions
Swift 5.9+ allows `if` and `switch` as expressions that return values. Use them
to assign, return, or initialize directly.
```swift
// Assign from if expression
let icon = if isComplete { "checkmark.circle.fill" } else { "circle" }
// Assign from switch expression
let label = switch status {
case .draft: "Draft"
case .published: "Published"
case .archived: "Archi