🍺 BREW Explorer

← all formulae

swiftgen

brew install swiftgen v6.6.3 MIT

Swift code generator that creates type-safe constants for assets, images, strings, colors, and storyboards in iOS/macOS projects.

Why you might care

Eliminates magic strings and hardcoded resource names in Swift projects, reducing runtime crashes from typos. Integrates into Xcode build phases to auto-generate constants from your asset catalogs, localization files, and interface definitions. Essential for teams wanting compile-time safety and IDE autocompletion for app resources.

Categories

Alternatives

R.swift Sourcery Tuist
9.3k
30-day installs · #372
22.1k
90-day · #485
98.0k
365-day · #427
9.5k
★ GitHub stars · updated 2mo ago

GitHub topics

code-generator ios localization stencil stencil-template swift templates uicolor uifont uiimage uistoryboard

Links

Blurb generated by claude-haiku-4-5 on today.

Raw metadata
{
  "aliases": [],
  "alternatives": [
    "R.swift",
    "Sourcery",
    "Tuist"
  ],
  "build_dependencies": [],
  "categories": [
    "code-generator",
    "build-system"
  ],
  "caveats": null,
  "conflicts_with": [],
  "dependencies": [],
  "deprecated": 0,
  "deprecation_reason": null,
  "desc": "Swift code generator for assets, storyboards, Localizable.strings, etc.",
  "disable_reason": null,
  "disabled": 0,
  "enrichment_fetched_at": "2026-06-20T23:40:50+00:00",
  "first_seen": "2026-06-20T23:34:18+00:00",
  "full_name": "swiftgen",
  "github_default_branch": "stable",
  "github_last_commit_at": "2026-04-16T08:20:58Z",
  "github_readme_excerpt": "# SwiftGen\n\n[![CocoaPods Compatible](https://img.shields.io/cocoapods/v/SwiftGen.svg)](https://img.shields.io/cocoapods/v/SwiftGen.svg)\n[![Platform](https://img.shields.io/cocoapods/p/SwiftGen.svg?style=flat)](http://cocoadocs.org/docsets/SwiftGen)\n![Swift 4.x](https://img.shields.io/badge/Swift-4.x-orange) ![Swift 5.x](https://img.shields.io/badge/Swift-5.x-orange)\n\nSwiftGen is a tool to automatically generate Swift code for resources of your projects (like images, localised strings, etc), to make them type-safe to use.\n\n\u003ctable border=\"0\"\u003e\u003ctr\u003e\n  \u003ctd\u003e\n    \u003cimg alt=\"SwiftGen Logo\" src=\"https://github.com/SwiftGen/Eve/raw/master/logo/logo-256.png\" /\u003e\n  \u003c/td\u003e\u003ctd\u003e\n    \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e\n        \u003cli\u003e\u003ca href=\"#configuration-file\"\u003eConfiguration File\u003c/a\u003e\n        \u003cli\u003e\u003ca href=\"#choosing-your-template\"\u003eChoosing your template\u003c/a\u003e\n        \u003cli\u003e\u003ca href=\"#additional-documentation\"\u003eAdditional documentation\u003c/a\u003e\n    \u003c/ul\u003e\n    Then generate constants for:\n    \u003cul\u003e\n      \u003cli\u003e\u003ca href=\"#asset-catalog\"\u003eAssets Catalogs\u003c/a\u003e\n      \u003cli\u003e\u003ca href=\"#colors\"\u003eColors\u003c/a\u003e\n      \u003cli\u003e\u003ca href=\"#core-data\"\u003eCore Data\u003c/a\u003e\n      \u003cli\u003e\u003ca href=\"#files\"\u003eFiles\u003c/a\u003e\n      \u003cli\u003e\u003ca href=\"#fonts\"\u003eFonts\u003c/a\u003e\n      \u003cli\u003e\u003ca href=\"#interface-builder\"\u003eInterface Builder files\u003c/a\u003e\n      \u003cli\u003e\u003ca href=\"#json-and-yaml\"\u003eJSON and YAML files\u003c/a\u003e\n      \u003cli\u003e\u003ca href=\"#plists\"\u003ePlists\u003c/a\u003e\n      \u003cli\u003e\u003ca href=\"#strings\"\u003eLocalizable strings\u003c/a\u003e\n    \u003c/ul\u003e\n  \u003c/td\u003e\n\u003c/tr\u003e\u003c/table\u003e\n\n\u003cspan style=\"float:none\" /\u003e\n\nThere are multiple benefits in using this:\n\n* Avoid any risk of typo when using a String\n* Free auto-completion\n* Avoid the risk of using a non-existing asset name\n* All this will be ensured by the compiler and thus avoid the risk of crashing at runtime.\n\nAlso, it\u0027s fully customizable thanks to Stencil templates, so even if it comes with predefined templates, you can make your own to generate whatever code fits your needs and your guidelines!\n\n## Installation\n\nThere are multiple possibilities to install ",
  "github_repo": "SwiftGen/SwiftGen",
  "github_stars": 9545,
  "github_topics": [
    "code-generator",
    "ios",
    "localization",
    "stencil",
    "stencil-template",
    "swift",
    "templates",
    "uicolor",
    "uifont",
    "uiimage",
    "uistoryboard"
  ],
  "homepage": "https://github.com/SwiftGen/SwiftGen",
  "homepage_og_description": null,
  "homepage_og_image": null,
  "homepage_title": null,
  "installs_30d": 9295,
  "installs_365d": 98029,
  "installs_90d": 22076,
  "keg_only": 0,
  "keg_only_reason": null,
  "last_seen": "2026-06-20T23:34:18+00:00",
  "license": "MIT",
  "llm_generated_at": "2026-06-20T23:44:27+00:00",
  "llm_model": "claude-haiku-4-5",
  "name": "swiftgen",
  "oldnames": [],
  "one_liner": "Swift code generator that creates type-safe constants for assets, images, strings, colors, and storyboards in iOS/macOS projects.",
  "optional_dependencies": [],
  "rank_30d": 372,
  "rank_365d": 427,
  "rank_90d": 485,
  "raw_hash": "5857b1c405abb2a5",
  "recommended_dependencies": [],
  "revision": 0,
  "ruby_source_path": "Formula/s/swiftgen.rb",
  "tap": "homebrew/core",
  "test_dependencies": [],
  "uses_from_macos": [
    {
      "ruby": "build"
    }
  ],
  "version_head": "HEAD",
  "version_stable": "6.6.3",
  "versioned_formulae": [],
  "why_use_this": "Eliminates magic strings and hardcoded resource names in Swift projects, reducing runtime crashes from typos. Integrates into Xcode build phases to auto-generate constants from your asset catalogs, localization files, and interface definitions. Essential for teams wanting compile-time safety and IDE autocompletion for app resources."
}