- Drop ImageEngine to project. (check "copy items if needed")
- Edit scheme -> Build -> pre-action -> click + -> New Run Script Action
- "$SRCROOT/Demo/Factory/ImageEngine" "$SRCROOT/${Asset.xcasset_path}" "$SRCROOT/${path_you_want _to_save}/ImageFactory.swift"
- Remember choice target.
- Build.
- Open finder and go to your project.
- Drop Image ImageFactory.swift to your project. (uncheck "copy items if needed")
- Enjoy it!
ImageEngine will creat a ImageFactory.switf
in your project. like this 👇