Creating Xcode-ready Assets on iOS

Now that I’ve resigned myself to creating assets for all the different devices, I am looking for ways to automate this process as much as possible.

Photoshop has a number of different asset generation options, so that’s easy enough.

However, I do a lot of drawings and design on my iPad using apps like Procreate and Affinity Designer.

These are great apps, but they lack the powerful asset generation capabilities of Photoshop.

I don’t want to have to manually export all the images for all the different required sizes from within these apps.

I could import the image into Photoshop, then set up image asset generation there. I could even place it a linked image in the Photoshop document and then any changes made to the underlying files will be reflected in that Photoshop document.

This still requires opening up Photoshop just to create a bunch of resized image assets, though, which seems inefficient.

What would be really nice is if I could do it all on the iPad…

Hacking At Shortcuts

The Shortcuts app has some limited image editing and file manipulation options.

After messing around with it for a while, I was able to create a Shortcut that can generate all the required assets.

It has a dictionary of device scale suffixes (e.g. @3x~iPhone) and resize percentages (e.g. 75% for 3x, 50% for 2x).

It then takes incoming images (which can either be selected within the shortcut itself via the Files app popup, or via the Shortcuts share extension available anywhere there is image sharing), and generates the resized images in the Shortcuts folder in iCloud Drive (you can also specify a subfolder for these exports when setting up the Shortcut).

These images are then automatically synced via iCloud to my Mac, ready to be imported directly into Xcode.

I’ve made the shortcut publicly available. Click this link on an iOS device and it should install it for you.