Say I have a project with 100 images that I've imported into a folder inside the main Images.xcassets file. Then I go and get updates for 67 of those images from my graphics designer - is there an easy way to push those image updates into the xcassets folder?
As it stands, I'm opening the xcassets file in Xcode, and for each of the images that's changed I'm dragging the new image into the little 2x or 1x box - I have to do that 67 times! I can't just drag/drop the files in Finder (the old way) because every image in the xcassets folder has its own subfolder. If I don't use the xcassets file for my images, I can easily update the files by doing this. But xcassets are supposed to "make managing your assets much simpler."
Fine - so what am I missing?
No need for Ruby, you can run this shell script to find files in a origin folder (where your updated images are), find files with the same name in your destination folder (.xcassets folder) and overwrite them with the updated version. Works great!
find ORIGIN FOLDER PATH NAME -name '*.png' | while read f; do f2=$(find DESTINATION FOLDER PATH -name "${f##*/}"); [[ $f2 ]] && cp "$f" "$f2"; done
I don't think you're missing anything. Assets folders are simply not well thought through. They introduce a few benefits, but a lot more flaws.
Take for example launch image. You can't set the same retina and retina 4-inch launch images for different iOS versions via assets without Xcode duplicating the files. I guess we have no other option but to submit enhancement requests via bug reporter and hope...
i wrote a ruby script to automate this task. Please follow the below link. https://gist.github.com/shirishgone/8036382
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With