Supercharge Swift with SwiftGen

The Swift code generation tool for colors, images, strings & more!

let image = Image("my-cool-image") // Stop doing this 😡
// swiftgen.ymlxcassets:
inputs:
- YourProjectName/Assets.xcassets // 1
outputs:
templateName: swift5 // 2
output: ProjectName/Assets.swift // 3
generated swift code, ty swiftgen!
let image = Image(Asset.myCoolImage) // Do this 😎
// swiftgen.ymlstrings:
inputs: TemplateProject/Localizable.strings // 1
outputs:
- templateName: structured-swift5
output: TemplateProject/Generated/Strings.swift
var body: some View {
Text(L10n.Onboarding.Buttons.join) // 🎉
}

⚠️ You can also concatenate Strings if they are dynamic using %@ in the Localizable.strings file.

xcassets:
inputs:
- YourProjectName/Assets.xcassets
outputs:
templatePath: xcassets-swiftui.stencil // 1
output: ProjectName/Assets.swift
var body: some View {
Asset
.myCoolImage
.image
.resizable()
.cornerRadius(10) // this compiles
}
🔊 audio narration

Shameless plug: if you enjoyed this check my Patreon or YouTube for tutorials and posts I make around Swift and swe’ing in general 😎

iOS Software Engineer ⚡️ Creator