# SwiftGen/SwiftGen

The Swift code generator for your assets, storyboards, Localizable.strings, … — Get rid of all String-based APIs!

Repository: https://github.com/SwiftGen/SwiftGen
Canonical: https://ross.abutalabs.com/products/swiftgen
Language: Swift
License: MIT
License Family: permissive
Topics: ios, swift, code-generator, templates, uistoryboard, uiimage, uifont, localization, stencil, stencil-template, uicolor
Last push: 2026-04-16T08:20:58+00:00

## Health v2 (maintenance only)
Score: 57/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 77, release rhythm 8, longevity 100
- inputs: {"age_days": 4067, "days_push": 139, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 9547, forks 765 (observed 2026-08-28T04:10:31.819785+00:00)

## What it is
SwiftGen is a command-line code generator that produces type-safe Swift constants for project resources like asset catalogs, storyboards, fonts, colors, and localized strings. It uses customizable Stencil templates and helps eliminate String-based APIs and runtime crashes from typos.

## Use cases
- generate type-safe constants for iOS asset catalogs
- avoid typos in localized strings lookups
- generate Swift code for storyboards and XIBs
- make UIColor and UIFont usage compiler-checked
- customize code generation with Stencil templates
- integrate resource code generation into Xcode build phase

## When to choose
- you develop iOS/macOS apps in Swift and want compile-time safety for assets and strings
- your team wants auto-completion instead of String-based resource APIs
- you need customizable code generation via templates

## When to avoid
- your project is not in Swift or not Apple-platform focused
- you only need one-off code generation without template customization
- you prefer runtime dynamic resource access over generated constants

## Facets
- artifact type: cli-tool
- maturity: active
- function: developer-tools, cli
- domain: developer-tools, mobile-development
- platform: cli
- tags: swift, ios, type-safety, stencil-templates, asset-catalogs, localization, storyboards, code-generator, code-generation, macos

## Member repositories
- SwiftGen/SwiftGen (main) score 57

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:10:31.819785+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:21:57.895606+00:00, confidence not recorded.
  - readme: https://github.com/SwiftGen/SwiftGen (fetched 2026-08-28T04:10:31.819785+00:00, sha 3b1e6119ebf2)
- Data as of 2026-08-30T08:39:29.467469+00:00.
