SwiftGen-Assets v6.0.0 Release Notes

Release Date: 2018-09-29 // over 5 years ago
  • ๐Ÿš€ โš ๏ธ This major version is a big milestone in which a lot of refactoring and cleaning has been done. Many features added over previous releases have been reworked and unified, while also preparing SwiftGen for future additions. This means that you'll need to adapt your configuration files (or command line invocations) and custom templates to work with this new major version.

    ๐Ÿ“š Read the SwiftGen 6.0 Migration Guide for a list of changes you'll need to apply.

    ๐Ÿ”„ Changes in other SwiftGen modules

    ๐Ÿ’ฅ Breaking Changes

    • ๐Ÿšš Don't normalize string keys while parsing, let all transformation be done on template side. This makes the developer responsible to keep the language file organized, duplications won't be removed.
      Diego Chohfi
      #257
    • โœ‚ Remove Swift 2 support.
      David Jennes
      #420
    • ๐Ÿšš Renamed the storyboards command to ib, to better reflect it's purpose. An alias for storyboards still exists, but it will be removed at some point.
      David Jennes
      #423
    • ๐Ÿฑ XCAssets: the generated templates won't namespace groups by default anymore, use the forceProvidesNamespaces flag to enable this behaviour again.
      jechris
      #453
    • ๐Ÿฑ XCAssets: the templates won't generate any all-values accessors anymore by default. Use the allValues flag to enable this behaviour again. Note: this replaces the old noAllValues flag (with an inverse behaviour).
      David Jennes
      #480
    • ๐Ÿฑ XCAssets: Dropped the deprecated allValues constant, use the type specific constants such as allColors, allDataItems and allImages. The default value of imageAlias has also been changed from Image to AssetImageTypeAlias, to be consistent with the other types.
      David Jennes
      #482
    • ๐Ÿ— Interface Builder: split up the storyboards template into 2 parts, one for scenes and one for segues.
      David Jennes
      #419

    ๐Ÿ†• New Features

    • โž• Add ability to list all custom fonts and register them using FontFamily.registerAllCustomFonts.
      Olivier Halligon
      #394
    • โž• Add support for Swift Package Manager and Mint.
      Yonas Kolb
      #411
    • ๐Ÿ‘• The swiftgen.yml config file now accepts multiple outputs for each command, allowing you to generate multiple outputs from the same files and content. This also means that the output parameter is now deprecated, in favour of the outputs parameter, and it may be removed in a future version of SwiftGen. Similarly, the paths parameter has been renamed to inputs for consistency. You can always use swiftgen config lint to validate your configuration file.
      David Jennes
      #424
      #510
    • ๐Ÿ‘• Use swiftlint:disable all in generated files to avoid interference with SwiftLint rules custom to the host project.
      Frederick Pietschmann
      David Jennes
      #409
      #506
    • ๐Ÿฑ XCAssets: Added support for NSDataAssets.
      Oliver Jones
      #444
    • ๐Ÿ‘ Organised the generated code in sections for better readability, with all generated constants at the top of the file.
      David Jennes
      Olivier Halligon
      #456
      #481
    • โž• Added support for JSON, Plist and YAML files using the swiftgen json, swiftgen plist and swiftgen yaml commands. The parsed contexts and the generated files for each command have been kept quite similar, for easier switching between file formats.
      John T McIntosh
      Toshihiro Suzuki
      Peter Livesey
      David Jennes
      #379
      #359
      #288
      #188
      #493
      #504
    • โšก๏ธ Updated the playgrounds with the new json, plist and yaml commands, and updated the other pages to reflect the template changes.
      David Jennes
      #495
    • ๐Ÿ”ง We're deprecating the old --template CLI option in favor of --templateName, to better match the naming of the other options and the configuration file. The old --template option will remain until the next major version.
      David Jennes
      #509

    ๐Ÿ› Bug Fixes

    • ๐Ÿ›  Fix memory leak in generated code for Fonts.
      Olivier Halligon
      #394
    • ๐Ÿ— Interface Builder: ensure the templates handle GLKViewController, AVPlayerViewController and NSPageController correctly.
      David Jennes
      #404
      #414
    • ๐Ÿ— Interface Builder: ensure the parser can handle files with and without "trait variations".
      David Jennes
      #367
      #429
    • ๐Ÿšš Restrict SceneType and InitialSceneType to UIViewController when not targeting AppKit. When targeting AppKit, remove superfluous Any.
      Darron Schall
      #463
      #464
    • Fonts: disable a warning in generated font files for projects with conditional_returns_on_newlines SwiftLint rule enabled.
      Ryan Davies
      #436
      #465
    • ๐Ÿ— Interface Builder: the parser and templates now handle the "Inherit module from target" setting.
      David Jennes
      #435
      #485
    • ๐Ÿ“œ Strings: the parser now correctly handles formats such as % d and %#x.
      David Jennes
      #502
    • Strings: ensure strings without arguments are not processed using String(format:).
      David Jennes
      #503

    Internal Changes