There are times when images provided by UI designers are not named the way you would like.
If this bothers you much, and you don't want to take the effort to modify file names and Contents.json
files as well, you should try this little tool.
As you might already guessed, this tool will modify content in Contents.json
file and change image asset file names to reflect the name you set to .imageset
item in Xcode, resulting matching asset file name and name set in xcode.
- Download this repo
- Open in Xcode
- Build
- Locate the built executable binary in
Product
section - Copy this binary to any directory which has
.xcassets
sub directory in it - Execute without any parameters
Or
-
Download this repo
-
Open in Xcode
-
Set the correct build destination (in Build Settings— Build Locations— Build Product Path) to any directory which has
.xcassets
sub directory in it -
Run
This is like a one-shot simple tool made in like half an hour, so in terms of dependency, I don't take a serious way like introducing those fancy dependency manager, instead, just grab and drag the source file in.
In this case it's PathKit, a fancy elegant library regarding path managing.