SwiftGen-Storyboard v3.0.0 Release Notes

    • ➕ Add template that calls NSLocalizedString() separately for each string, which is useful when trying to extract strings in the app to a .strings file.
      Ahmet Karalar
    • ➕ Add some file_length and similar SwiftLint exceptions in bundled templates, as files generated by SwiftGen might contain lots of constants and can be long by design.
      Olivier Halligon
    • 🖨 Error messages ("template not found", etc) are now printed on stderr.
      Olivier Halligon
    • ➕ Add more swiftgen templates subcommands.
      Olivier Halligon
      • swiftgen templates list lists all the available templates
      • swiftgen templates which <name> prints the path to the template named <name>
      • swiftgen templates cat <name> prints the content to the template named <name>
      • <name> here can be either a parser name like colors or a composed name colors-rawValue for a specific template.
    • 🛠 Fix swift 3 renaming change in strings-swift3.stencil.
      Kilian Koeltzsch #150
    • 🛠 Fix non-custom class, non-base view controller handling in storyboards-swift3.stencil.
      Syo Ikeda #152
    • ➕ Add strongly typed initialViewController() overrides for storyboard templates if available.
      Syo Ikeda #153 #163
    • ➕ Add support for font files containing multiple descriptors.
      Chris Ellsworth #156
    • ⚡️ Update deprecated usage of generics for Swift 3 / Xcode 8 beta 6.
      Chris Ellsworth #158
    • 🛠 Fix case when missing positional parameters, which leads to parameters in the enum with unspecified type (undeterminable from the Localizable.strings format analysis) where reported as Any — which is not a CVarArgType. Now using UnsafePointer<()> arguments instead for such odd edge-cases that should never happen anyway.
      Olivier Halligon
    • 📜 Now reports an error when it failed to parse a color in a color input file.
      Olivier Halligon #162
    • 🆕 New Strings template (available via -t dot-syntax), allowing string keys containing dots (like foo.bar.baz) to be organized as a hierarchy and accessible via dot syntax.
      Cihat Gündüz #159
    • ⚡️ Update Swift 3 templates to use lowercase enums.
      Olivier Halligon #166
    • 🆕 New Strings template (available via -t dot-syntax-swift3), allowing keys with dots in Swift 3 (see above).
      Cihat Gündüz #168

    💡 You can now create your custom templates more easier than ever, by cloning an existing template!

    0️⃣ > e.g. to clone the default strings-default.stencil template:

    • use swiftgen templates cat strings --output strings-custom.stencil 👯 > * modify the cloned strings-custom.stencil template to your liking
    • use it with swiftgen strings … --templatePath strings-custom.stencil … in your projects!

    Important Notes

    • Some keys for various templates have changed to provide more flexibility and enable some new features in the templates. As a result, if you created your own custom templates, they might not all be totally compatible with SwiftGen 3.0.0 (hence the new major version). 📚 Please read the Custom Templates documentation to find out the new Stencil context keys and update your custom templates accordingly.

    ⚡️ If you're using one of the bundled templates, all of them have been updated appropriately.

    • Also if you use Swift 3, and thus use the -t swift3 flag to use the Swift 3 templates, be advised those has been modified to take the latest Swift 3 modifications into account (including naming convensions) so your code might need to be updated according to match the latest Swift 3 recommendations.