On this page
Overview
SwiftGen is a CLI that generates Swift code from resources in iOS and macOS projects. It parses asset catalogs, localized strings, fonts, storyboards, Core Data, JSON/YAML, and more so string-based resource names can become compiler-checked constants and APIs.
Features and best fit
Based on official documentation; not hands-on tested · Content checked:
Key features
Turn resource names into generated code checked by the compiler
Parsers read xcassets, strings, fonts, Interface Builder files, Core Data models, and other resources to generate Swift types such as image assets and localized-string accessors. This reduces raw string references and enables autocomplete and compile-time checking.
Sources: [2]
Version generation rules through swiftgen.yml and Stencil templates
A swiftgen.yml file declares inputs, outputs, and templates, and swiftgen config run or swiftgen executes the configured parsers. Bundled templates can be replaced with Stencil-based custom templates.
Sources: [2]
Best fit
Fits iOS projects with many assets and localizations that want fewer string-based APIs
Teams can centralize image names, colors, localization keys, and storyboard identifiers in generated code. Pinning the generator version and configuration in the repository helps keep developers and CI consistent.
Sources: [2]
Before adoption
The latest release is 6.6.3 from 2024 while the repository still has 2026 activity
The latest GitHub release is 6.6.3 from March 2024. Its Package.swift uses Swift tools 5.6 and macOS 10.11+. Because the repository continued receiving pushes in 2026, compare unreleased stable-branch changes with 6.6.3 and pin the production tool version explicitly.
Official sources
- [1]SwiftGen/SwiftGen — GitHub repository(2026-10-06)
- [2]SwiftGen 6.6.3 — README(2026-10-06)
- [3]SwiftGen 6.6.3 — Package.swift(2026-10-06)
- [4]SwiftGen 6.6.3 release(2026-10-06)
- [5]SwiftGen MIT license(2026-10-06)
Supplemental curator note
SwiftGen fits iOS projects that want to replace string-based image names, colors, localization keys, and storyboard identifiers with generated APIs. The latest release is from 2024, so compare it with current stable-branch changes and pin the tool version.
Try it in 3 steps
- 1
Pin SwiftGen 6.6.3 through Mint
Use the Mint workflow documented by SwiftGen and pin the reviewed project version to 6.6.3.
mint run SwiftGen/SwiftGen@6.6.3 swiftgen --version - 2
Create a minimal swiftgen.yml
Configure the Asset Catalog parser to generate type-safe resource APIs into Generated/Assets.swift.
cat > swiftgen.yml <<'YAML' xcassets: inputs: Resources/Images.xcassets outputs: - templateName: swift5 output: Generated/Assets.swift YAML - 3
Generate code from the config
Run the pinned generator against swiftgen.yml and inspect the generated Swift source.
mint run SwiftGen/SwiftGen@6.6.3 swiftgen config run
Growth
Growth trends · Last 30 days
9,548 Stars
Trend data is still being collected.
Development activity
Last 90 days · weekly
- Commits (last 30 days)
- 0
- Open PRs
- 32
Development activity is still being collected.
Built with
Categories and tags
Categories
GitHub data
GitHub dataView detailed GitHub data
GitHub Topics
- ios
- swift
- code-generator
- templates
- uistoryboard
- uiimage
- uifont
- localization
- stencil
- stencil-template
- uicolor
Related information
Write a related articleShare a guide or use case for this OSS in Markdown. Articles are published after administrator approval.
Explore next
- Nx29,392 Stars
1 shared tag(s) · 2 shared category(s)
Model project dependencies and run only the tasks that a change requires
TypeScript - Jenkins26,621 Stars
1 shared tag(s) · 2 shared category(s)
Automate builds, tests, analysis, and deployment with jobs, pipelines, and a large Java plugin ecosystem
Java - Cookiecutter25,129 Stars
1 shared tag(s) · 2 shared category(s)
generate reusable project skeletons from Jinja templates and prompted variables
Python - Skyvern23,140 Stars
1 shared tag(s) · 2 shared category(s)
automate browser workflows with LLM reasoning and visual understanding instead of fixed selectors
Python - Renovate22,688 Stars
1 shared tag(s) · 2 shared category(s)
automate dependency discovery and update pull requests across 90+ package managers
TypeScript - Gradle18,875 Stars
1 shared tag(s) · 2 shared category(s)
unify multi-project builds, tests, dependencies, and packaging through task graphs and plugins
Groovy
Report incorrect information
Tell us if any listing information is incorrect or outdated.