What problem does it solve?
Applies modern Swift language patterns and idioms to reduce unidiomatic, error-prone, or legacy core Swift code and make implementations clearer, safer, and more maintainable. It addresses common pitfalls such as incorrect Codable handling, inefficient collection usage, unclear type abstraction between opaque and existential types, and inconsistent formatting or regex usage.
Core Features & Use Cases
- Language pattern guidance: If/switch expressions, guard patterns, Never type, typed throws, and advice on when to use some versus any to improve performance and API clarity.
- APIs and parsing: Codable best practices, nested container decoding, loss-tolerant arrays, RegexBuilder patterns, and FormatStyle for dates, numbers, measurements, and lists.
- Developer workflows: Use when implementing or reviewing core library code, decoding JSON APIs, designing generic APIs with opaque/existential types, or migrating legacy formatting/regex logic.
- Real-world example: Refactor a network model decoding pipeline to use custom CodingKeys, decodeIfPresent with sensible defaults, apply FormatStyle for presentation, and replace manual loops with modern collection APIs.
Quick Start
Ask the assistant to refactor a function or type to use typed throws, proper Codable CodingKeys with decodeIfPresent defaults, and .formatted() for dates to produce idiomatic Swift 6 code.