
Swift Codable
This gives you everything you need to parse JSON in Swift without fighting the type system. It covers the basics like auto-synthesized conformance and CodingKeys for snake_case remapping, but the real value is in the advanced patterns: flattening nested JSON with nestedContainer, decoding heterogeneous arrays with discriminators, lossy decoding that skips bad elements instead of failing the whole array, and practical integration with URLSession and SwiftData. The date and key strategy examples alone will save you from reinventing that logic. If you're doing anything beyond trivial JSON parsing in a Swift app, you'll reference this.
- skills.sh installs
- 3.8K
- GitHub stars
- 1.3K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add dpearson2699/swift-ios-skills --skill swift-codable --agent claude-codeInstalls into .claude/skills of the current project.
Files
Swift Codable
Encode and decode Swift types using Codable (Encodable & Decodable) with
JSONEncoder, JSONDecoder, and related APIs. Targets Swift 6.3 / iOS 26+.
Contents
- Decode and Verify Workflow
- Basic Conformance
- Custom CodingKeys
- Custom Decoding and Encoding
- Nested and Flattened Containers
- Heterogeneous Arrays
- Date Decoding Strategies
- Data and Key Strategies
- Lossy Array Decoding
- Single Value Containers
- Default Values for Missing Keys
- Encoder and Decoder Configuration
- Codable with URLSession
- Codable with SwiftData
- Codable with UserDefaults
- Common Mistakes
- Review Checklist
- References
Decode and Verify Workflow
Sponsors
Details
- Repository
- github.com/dpearson2699/swift-ios-skills
- Categories
- Backend & APIs, Mobile Development
- First seen
- Apr 16, 2026
More from dpearson2699/swift-ios-skills
All 98- Tipkit3.8K
- App Clips3.8K
- Permissionkit3.7K
- Energykit3.7K
- Shareplay Activities3.7K
- Weatherkit3.6K
- Activitykit3.5K
- Cloudkit3.5K
- Photokit3.4K
- Mapkit3.4K
- Swiftui Webkit3.4K
- Realitykit3.4K
- Avkit3.4K
- Spritekit3.3K
- Cryptokit3.3K
- Metrickit3.3K
- Pdfkit3.3K
- Gamekit3.3K
- Eventkit3.3K
- Musickit3.3K
- Swift Architecture3.3K
- Pencilkit3.3K
- Carplay3.2K
- Ios Simulator3.2K