{"enrichment":{"faq":[{"a":"swift-format-style teaches you to adopt modern FormatStyle APIs instead of legacy Formatter subclasses. Replace DateFormatter, NumberFormatter, and similar classes with .formatted() methods on your values. For example, use `date.formatted(.dateTime.year().month().day())` instead of instantiating DateFormatter. FormatStyle is type-safe, Codable, and Hashable\u2014making it ideal for iOS 15+ apps.","q":"How do I use FormatStyle in Swift to replace legacy formatters?"},{"a":"swift-format-style covers locale-aware currency formatting through FormatStyle. Use `.formatted(.currency(code: \"USD\"))` on Decimal or Double values to get proper symbol, grouping, and decimal placement. FormatStyle automatically respects the user's locale settings, eliminating manual currency symbol handling. This approach is safer and more maintainable than building format strings by hand.","q":"What are the best practices for swift currency formatting?"},{"a":"swift-format-style shows how to replace C-style String(format:) calls with modern .formatted() syntax. Instead of `String(format: \"%.2f\", value)`, use `value.formatted(.number.precision(.fractionLength(2)))`. The .formatted() API is type-checked at compile time, supports SwiftUI Text views natively, and eliminates format-string bugs. This skill guides you through common migration patterns.","q":"How do I migrate from C-style String(format:) to .formatted() methods?"},{"a":"Yes. swift-format-style provides comprehensive guidance on date and time formatting with FormatStyle. Use `.formatted(.dateTime.year().month().day().hour().minute())` to customize output, or choose presets like `.dateTime.abbreviated`. FormatStyle handles locale-aware formatting automatically, replacing DateFormatter entirely for most use cases on iOS 15+.","q":"Can swift-format-style help with FormatStyle date time formatting?"},{"a":"swift-format-style explains how to use the `format:` parameter in SwiftUI Text views. Pass a FormatStyle directly: `Text(date, format: .dateTime.year().month().day())`. This approach is more efficient than calling .formatted() separately and keeps formatting logic declarative within your view hierarchy.","q":"How do I integrate FormatStyle with SwiftUI Text views properly?"},{"a":"swift-format-style guides you through modern number formatting with FormatStyle, including integers, decimals, percentages, and byte counts. Use `.formatted(.number.precision(.fractionLength(2)))` for decimals or `.formatted(.byteCount(style: .file))` for file sizes. These APIs replace NumberFormatter and provide compile-time safety with automatic locale adaptation.","q":"What does swift-format-style cover for modern number formatting?"}],"shadow_tags":["api-modernization","swift-formatting","legacy-deprecation","locale-aware-output","type-safe-formatting","swiftui-integration","code-review-guide","ios-15-plus"],"summary_rewrite":"This skill guides you through adopting Swift's modern FormatStyle APIs for formatting values across numbers, dates, durations, measurements, and other types. It identifies legacy patterns like DateFormatter and C-style String(format:) calls, then shows you how to replace them with contemporary .formatted() methods and FormatStyle configurations. Perfect for modernizing iOS 15+ codebases."},"files":[{"bytes":4263,"path":"swift-format-style/SKILL.md","sha256":"8a4983d20be3fe0fce4df2f4b0058b4a68d0bdab42a137b5023ed8b4f7153e43","url":"https://skillfed.io/files/n0an/Swift-FormatStyle-Agent-Skill/swift-format-style/c8f8d402/SKILL.md"}],"id":"n0an/Swift-FormatStyle-Agent-Skill/swift-format-style","links":{"html":"https://skillfed.io/n0an/Swift-FormatStyle-Agent-Skill/swift-format-style","md":"https://skillfed.io/n0an/Swift-FormatStyle-Agent-Skill/swift-format-style.md","repo":"https://github.com/n0an/Swift-FormatStyle-Agent-Skill"},"meta":{"agents_supported":[],"first_seen":"2026-07-28","forks":0,"language":null,"last_updated":"2026-04-16","license":"MIT","name":"swift-format-style","publisher":"n0an","stars":7},"relations":{"similar":[{"id":"dpearson2699/swift-ios-skills/swift-formatstyle"},{"id":"dpearson2699/swift-ios-skills/swift-language"},{"id":"CharlesWiltgen/Axiom/axiom-analyze-swiftui-performance"},{"id":"CharlesWiltgen/Axiom/axiom-swift"},{"id":"dpearson2699/swift-ios-skills/swiftui-performance"},{"id":"dpearson2699/swift-ios-skills/ios-localization"},{"id":"rshankras/claude-code-apple-skills/swiftui-debugging"},{"id":"rshankras/claude-code-apple-skills/localization-setup"},{"id":"steipete/agent-scripts/swiftui-performance-audit"},{"id":"CharlesWiltgen/Axiom/axiom-audit-swiftui-architecture"}]},"slug":{"owner":"n0an","repo":"Swift-FormatStyle-Agent-Skill","skill":"swift-format-style"},"version":"c8f8d402"}
