Skip to content

Releases: kayak/SwiftFrame

More flexible slicing

26 Mar 13:50
6.0.0
88c7bb9
Compare
Choose a tag to compare

New slicing mechanism

This version introduces breaking changes to the parsing of configuration files, so we bumped to a new major version.

From now on it will be your own responsibility to make sure your template images have the correct width so that the output slices are accepted by App Store Connect or the likes. SwiftFrame now expects numberOfSlices key in each object of the deviceData array which defines how many slices the template file will be rendered into. It automatically calculates the slice size based on this value, the size of the template file and the gap width if any.

Migration Guide

Most configuration files can be easily migrated by simply adding the new key numberOfSlices to each deviceData object with the value you expect.

What's Changed

Full Changelog: 5.0.1...6.0.0

5.0.0 CLI Flag Changes

30 Sep 12:32
5.0.0
59270c1
Compare
Choose a tag to compare

Welcome to a new major version of SwiftFrame. Here's what changed:

Deprecations/Removals

  • parsing for outputWholeImage and clearDirectories from the config files has been removed. These options have been changed to CLI flags. Keep reading below for details

CLI Flag Changes

New

  • --output-whole-image is the equivalent to previously specifying outputWholeImage in your config file and behaves the same
  • --no-clear-directories is the equivalent to previously specifying clearDirectories in your config file. By default, specified output directories will be cleared before writing images to them. If you specify --no-clear-directories this behavior will be disabled.

Changed

  • --no-manual-validation has been changed to --manual-validation and its behavior has been inverted. This flag can now be used independently of -v/--verbose, meaning you can have manual validation without debug logging for example. If you specify this flag, SwiftFrame will pause after parsing the config file and wait you to confirm its contents
  • -v/--verbose now doesn't enable manual validation anymore. Its sole purpose/effect is enabling extended logging for debugging purposes

Migration Guide

  • remove outputWholeImage and clearDirectories from your config files
  • adjust your swiftframe render invocation to include --output-whole-image (if value was true previously) and/or --no-clear-directories (if value was false previously)

Full Changelog: 4.1.2...5.0.0

Improve title generation logic

02 Mar 12:31
Compare
Choose a tag to compare

This release addresses an issue we had with generating the titles. To support HTML markup in the title strings we were using the NSAttributedString's default HTML parsing, which is only able to interpret fonts that are in .ttc format, installed on the system and contain the traits included in the markup.

For flexibility, we now only try to parse the strings from HTML if the title string contains HTML markup. When no HTML markup is used, we construct the strings using the default NSAttributedString attributes to allow for .ttf and .otf fonts that are not installed on the system.

Scaffolding

16 Dec 09:57
38ce622
Compare
Choose a tag to compare

This release brings a new subcommand scaffold (you don't have to explicitly use the render subcommand as it is the default one). It is useful when getting started with SwiftFrame as it will help you create the necessary folder structure.

Usage Overview

At the minimum, SwiftFrame expects one locale and a path where to create the folders. For example:

swiftframe scaffold "en-US" "de-DE" --path "/some/path/to/your/app/SwiftFrame"

This will create a couple folders and files, which will have the following structure:

$ tree some/path/to/your/app/SwiftFrame

├── Screenshots
│   ├── iPadPro12.9
│   │   ├── de-DE
│   │   │   └── README.md
│   │   └── en-US
│   │       └── README.md
│   └── iPhoneX
│       ├── de-DE
│       │   └── README.md
│       └── en-US
│           └── README.md
├── Strings
│   ├── de-DE.strings
│   └── en-US.strings
├── Templates
└── config.json

9 directories, 7 files

Two things are worth mentioning here. SwiftFrame uses a default list of devices that it creates screenshot directories for. Also, it adds README.md files to each of the screenshot directories to help you remember which screenshots go where.

For more information about available flags and options, use the --help flag

QOL Updates and Bug Fixes

22 Nov 11:05
b56efb1
Compare
Choose a tag to compare

This release is a bit more than a patch. The main issue this release focuses on is a crash due to a segmentation fault reported by @Pispa339.

Goodbye segmentation fault

To address this, the order of processing was changed slightly. Instead of parsing the strings that can include HTML markup just in time when SwiftFrame renders them on the canvas, we now process all strings at the beginning and cache them. While that obviously increases the memory footprint a bit, it also means that we don't have to re-sync to the main thread for String parsing while doing asynchronous work - which turned out to be the cause for the segmentation fault.

New Features

There are two new optional flags you can use when invoking SwiftFrame.

  • --no-manual-validation will skip the manual validation step that comes with specifying --verbose. The config file will still be validated but you won't be asked to confirm its contents.
  • --no-color-output disables all colored output. Useful for CI jobs for example if you want to download log files from them

Other Changes

  • minimum required Swift version has been bumped to Swift 5.4
  • minimum macOS version required to run SwiftFrame has been bumped to macOS 10.15
  • there are now more expressive error messages if using --verbose and an error occurs during asynchronous processing
  • --verbose now outputs some more granular time measurements
  • you can now use a new benchmark tool to get a more realistic sense of performance compared to running the example. The script is invokable with ./benchmark.py

Full Changelog: 4.0.0...4.0.1

Support for multiple output suffixes

28 Aug 13:25
cdef5e9
Compare
Choose a tag to compare

This release adds support for specifying multiple output suffixes in the deviceData objects in SwiftFrame config files. The outputSuffix key has been renamed to outputSuffixes and now expects an array of Strings (please make sure to update your old config files). The ability to specify multiple suffixes is useful for example rendering the same screenshots for two different devices (e.g. 2nd and 3rd generation 12.9” iPad Pro)

Binary checksum: 6213b1709897d16d3d6f2ec2ccf59f07f3a7380c53bda3ecf1a62e26c8d54f09
(use shasum -a 256 path/to/swiftframe/binary to verify)

Fix msgtracer leak

24 Aug 07:14
8e754c9
Compare
Choose a tag to compare

This release fixes a bug that would occur when rendering a lot of locales and device sizes at once. The console printed Context leak detected, msgtracer returned -1 but no actual errors were reported/thrown. This should now be fixed and not happen again

Binary checksum: 198b9654b346630abd34aff9850b3d81d5376389abbf1a0cf2b25e8bbd43e7d8
(use shasum -a 256 path/to/swiftframe/binary to verify)

Support for slice size override

18 Aug 09:54
8a580ff
Compare
Choose a tag to compare

This release adds the ability to specify a slice size override in the deviceData objects in your config files. Use cases for this are for example if you want to use iPhone X screenshots with an iPhone 8 template file (or even multiple different devices within one template file). For more information see the README file

Binary checksum: d26d70ead0a49eca17f6fff9be31fc9f306883ec932e6eaabda0245d93edbd6c
(use shasum -a 256 path/to/swiftframe/binary to verify)

Fix wrong character encoding for non-ASCII characters

14 Aug 08:11
Compare
Choose a tag to compare

This release fixes a bug where non-ASCII would be rendered incorrectly due to wrong character encoding when parsing the strings from file. Please make sure to format your .strings files with UTF-8 encoding

Binary checksum: c5f8480391cf2656397eacc8973e3901724f272903ef37a5cd0d4a89ca0d8dd8
(use shasum -a 256 path/to/swiftframe/binary to verify)

Support for vertical text alignment

11 Aug 07:09
caff9eb
Compare
Choose a tag to compare

We’ve been hard working during these hot summer weeks and got another SwiftFrame update for you. You can now specify the horizontal and vertical alignment of text within its bounding boxes.
The alignment key in the config files now requires an object with two sub-keys vertical and horizontal instead of just a string. horizontal still supports all the alignment styles you’re used to from CSS (left, right, justify, etc.) and vertical supports top, center and bottom.
Text rendering apart from the vertical alignment has not changed, so all you need to do to get started with this new version of SwiftFrame is update your config files and CI invocations (see Other Changes section below)

Other Changes

  • --config-path is now an argument rather than an option since it is required to run SwiftFrame, so it made sense to remove this possible source of confusion. You can simply drop the flag and you should be good to go (for additional help call swiftframe --help)
  • SwiftFrame can now generate bash autocompletion scripts (although there is not that much to autocomplete if we’re being honest), for more information see the ArgumentParser documentation
  • Previously we had to subtract a very small number (``1e-7to be exact) from the maximum fitting font size to avoidCoreText` not rendering text correctly. This has been resolved
  • We streamlined a bunch of stuff under the hood to make development on SwiftFrame easier in the future

Binary checksum: 74a08fa35fc4bf86db7d7ae4064386ae8174bd590b93196a1ab0302911ff2beb
(use shasum -a 256 path/to/swiftframe/binary to verify)