This skill helps you master Swift core language structures such as collections, optionals, closures, and generics for robust, expressive apps.
npx playbooks add skill swiftzilla/skills --skill swift_structure
This skill covers Swift's core language structures and features for building robust applications.
Swift structure skills cover the fundamental building blocks of the language: collections, optionals, control flow, closures, and other essential language features.
| Collection | Order | Duplicates | Use When |
|------------|-------|------------|----------|
| Array | Ordered | Allowed | Indexed access needed |
| Dictionary | Unordered | Keys unique | Key-based lookup |
| Set | Unordered | Not allowed | Uniqueness required |
// Optional binding
if let value = optional { }
guard let value = optional else { return }
// Nil coalescing
let value = optional ?? defaultValue
// Optional chaining
let result = object?.property?.method()
array.map { $0 * 2 } // Transform
array.filter { $0 > 0 } // Select
array.reduce(0, +) // Combine
array.compactMap { Int($0) } // Transform + remove nil
array.flatMap { $0 } // Flatten
Each reference file contains detailed information, code examples, and best practices for specific topics. Visit https://swiftzilla.dev for comprehensive Swift documentation.
Weekly roundup of top Claude Code skills, MCP servers, and AI coding tips.