When using the asset catalog, I usually name the image set in the same way as the image file. E.g. I create an image set leftIcon
with files leftIcon@2x.png
and leftIcon@3x.png
in it.
Today I decided different.
I created an image set named button_pressed_background
and used a file called grey_background.png
.
When fetching the icon with UIImageNamed:@"..."
, I was not sure which name to use. It turned out, that I need to use the asset catalog image set name, e.g.
UIImageNamed:@button_pressed_background"
, not the filename (which returns nil
when used).
Last question I had, was: Since I used a small grey icon to fill the complete button, is the grey on a 3x-Device the same as on the 2x device? Or do I need a 2x and 3x version of the image file, although it only contains grey pixels? I assumed no, since it looked OK. So hopefully the customers will agree…