generate-imageasset-symbols
is a tiny little Mac command-line tool that creates a
header file containing NSString
constants for the images in the given .xcassets
folder. Combined with a custom build step in your Xcode project and a bit of macro
magic, it can be used to automatically give compile-time checked keys for your
image names.
generate-imageasset-symbols
is licensed under three-clause BSD. The license document can be
found here.
- Clone generate-imageasset-symbols using
$ git clone git://github.com/iKenndac/generate-imageasset-symbols.git
. - Open the project and build away!
$ generate-imageasset-symbols -assets <path to .xcassets folder> -out <output path> [-prefix <string>] [-suffix <string>]
-
-assets
The path to a valid .xcassets folder. -
-out
The path to write the output header file to. Missing directories will be created along the way. If a file already exists at the given path, it will be overwritten. -
-prefix
A string to prefix the generated symbol names with. -
-suffix
A string to append to generated symbol names.