Is there a trick to copy an asset like an image set from one asset catalog to another in Xcode? I have a large asset catalog in a project that I would like to break down into smaller ones.
I just go to Finder, open the .xcassets source folder, and manually copy the .imageset files I'm interested in from it to the target .xcassets folder. In general, XCode sees the changes automatically, even if it's open during the operation (I tried it successfully in XCode 9.2).
After having copied, in order to make XCode completely aware of the resources, you can go through them, rename each one (for example by just adding a "" character at the end of the name), press ENTER and then rename them back to their original names (delete the added "" character). That way you will ensure that they are built into the project. This last operation is a bit tedious but could be pretty fast if you use only the keyboard.
Sometimes, this may require XCode to be restarted (and a project clean may be also good).
A second editor can be used to drag/drop files from one asset catalog to another.
Select the source assets catalog, then select the "add editor" button.
Select the destination assets catalog.
Select the assets to be moved.
Drag those files into the destination assets catalog.
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