Add many images to xcodes asset catalog - how to manage naming and 1x,2x,3x for each?
Asked Answered
P

2

9

I have an app where I would like to add many images (500+) to xcode's asset catalog. Adding the 1x images was easy, I simply had to drag the first folder. However to add the 2x and 3x images it seems I would need to drag each image in manually, and I'd prefer not to do that. The 3 different sizes for each image are all named the same, w/ just different sizes. Is there anyway to automate this process?

Panelboard answered 21/5, 2016 at 4:25 Comment(0)
E
10

You can named image something like : yourimg.png, [email protected], [email protected] ,so it's become one set. Let's take another : dogImg.png, [email protected], [email protected] then this is second set.

So, you can name images like this and put every images to one single folder.

Then you simply drag and drop that folder to xcode, and you have done!

No need to use assets in this case! this naming conversion manage same as assetts.!

Refer Raywebderlich's one tutorial's portion where they are adding images like this.

OR (recommended way - because it is using assets)

Name your images like - [email protected], [email protected], [email protected] and drag all them in to the assets and it will automatically take place at proper location. That's it!!

You can maintain folder structure also. For example If you have folder structure like below screen shot,

enter image description here

and If you drag and drop whole Images folder to assets then xcode will manage everything for you(see result in below screenshot) but you just need to keep in mind that follow the naming standard for the images like [email protected], [email protected], [email protected]. You can ignore @ for 1x image, I mean your image set can be like test.png, [email protected], [email protected] also!

Screenshot of assets after dragging Images from the finder,

enter image description here

Eachern answered 21/5, 2016 at 5:56 Comment(1)
this solution not support bitCodeMapes
M
0

Happyxcasset is a python script that easily imports resource files into xcassets in Xcode. https://github.com/qdvictory/happyxcasset You will like it.

Mm answered 9/7, 2017 at 3:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.