This gist was published as part of the Twitch GitHub Organization. It is distributed under the MIT license
The script below is a tool to generate code references from the Xcode asset catalog. The benefit of this is a type safe, typo safe, and compile time checked API for your Image assets. This is in contrast to the current String based UIImage
API of UIKit, which does not produce compile time errors when an asset is renamed or removed from the catalog.
In order to generate the image assets during a Build Phase, you will first need to add a new file with the name ImageAssets.swift
to your project. This is important as the project file should not be modified during compile time.