Process Xcode imagesets into compiler-checkable files
Reads your .xcassets directory and generates functions, categories, or constants. Supports both Swift and Objective-C, and allows custom templates.
$ pip install imageset
$ imageset --help
For details. The category/extension mode seems best to me.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.