OSS TanbouSign in with GitHub

generate type-safe Swift APIs for assets, localized strings, storyboards, and other resources

About these scores

OSS scale score is an unbounded metric that log-compresses and weights Stars, Watchers, Forks, and Contributors. Discovery score is the current OSS scale score minus the score at discovery. Update pace is commits in the last 30 days, growth momentum is the OSS scale score difference within the recent observation window, and OSS health is a 0–100 rating based on available recency, Community Health, and release data.

Stars
9,548
Primary language
Swift
License
MIT
Repository last updated
Apr 16, 2026
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.

Sources: [4][3][1]

Official sources

  1. [1]SwiftGen/SwiftGen — GitHub repository(2026-10-06)
  2. [2]SwiftGen 6.6.3 — README(2026-10-06)
  3. [3]SwiftGen 6.6.3 — Package.swift(2026-10-06)
  4. [4]SwiftGen 6.6.3 release(2026-10-06)
  5. [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. 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. 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. 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
Check the official README

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

GitHub data

GitHub dataView detailed GitHub data

GitHub Topics

  • ios
  • swift
  • code-generator
  • templates
  • uistoryboard
  • uiimage
  • uifont
  • localization
  • stencil
  • stencil-template
  • uicolor
Stars
9,548
Forks
763
Watchers
105
Open issues
125
Contributors
87
Owner type
Organization
Primary language
Swift
License
MIT
Repository last updated
Apr 16, 2026
Write a related article

Share a guide or use case for this OSS in Markdown. Articles are published after administrator approval.

Report incorrect information

Tell us if any listing information is incorrect or outdated.

After reading this page, do you know what to do next?