Just like the title says, 1x images are useless in my project now.
Is there any easy way to delete all 1x images at once?
I'm using xcassets to manage my images.
Thanks.
How about to open your project's folder in Finder and find your xcassets folder. Open it and you will find all images and also will be able to remove all you no longer need.
Related
If you look at this thread
iOS 7 App Icons, Launch images And Naming Convention While Keeping iOS 6 Icons
You see that xcode used to show a nice table where you could see all icon/launch image dimensions, what is missing etc.
I just managed to start migrating our app to ios8/iphone6 so i also upgraded xcode. However, now i can't seem to locate that table anymore, all there is is an empty section with buttons to "use asset catalog":
So, i have 2 questions:
is the table somewhere else, or is "asset catalog" the way to go now?
I tried the asset catalog, and all images are copied into this xcassets catalog. Is there any reason for me to keep the original files in the project? Do i need it for anything else, like ios5? I looked around but found no answer.
Thankful for some pointers.
Use the Asset catalog , this is the preferred way now.
If you use the asset catalog, all the images will be copied to images.xcassets, there is no need to keep the original files. If you control click the assets and show in finder, you could find the copied images. In asset catalog you have options to give different images for iOS 5,6,7 landscpae or portrait whatever is appropriate for your app.
I am trying to use the image.xcassets in the newer xcode versions but i need to understand it better before proceeding it. Can any one help me out of it like,
1. what is image.xcassets exactly?
2. what is the purpose of using it?
3. how do i add and delete images into the assets?
4. is this only for launcher and splash images or is it possible to use our app images too?
Thanks in advance.
It is a utility in xcode that provide ease to add launch images and app-icons.
Just make the icon size and launch image size accordingly and drag them to the respective place.
I think for app icon 58*58,80*80 and 120*120 are the sizes, and for lauch image 640*960 and 640*1136 just make your .png images to those sizes add them to your project and place over there.
To remove image from there right click on that and remove item.
I am trying to create a launch image for my (first) iphone app. I have done the following:
created 2 PNG images for this purpose.
one image is: 640 x 960 pixels
the other is: 640 x 1136 pixels
added the above 2 files to my project, under "Supporting Files"
In the asset catalog, I select my "LaunchImage" image set, and set its attributes to only support iPhone Portrait, iOS 7 and above
I try to drag each of images mentioned above from "Supporting files" into the 2 place holder images (Retina and #2x). The images are not accepted. I do not get an error, but the images are never drawn, and the image is not used when the application launches.
If instead I try to import the files by selecting "import" from the context menu, I get the same behavior. No error, no image.
Do I need to do anything else? Like follow a naming convention?
Per what I have read, the names of these files no longer matter - though I have tried naming them:
LaunchImage.png (640x960) and LaunchImage#2x.png (640x1136). This has not made any difference.
Any help would be greatly appreciated.
Just change the file extension from "PNG" (upper-case) to "png" (lower-case). I spent a couple of hours futzing around until I finally figured out that was the issue!
Note that screenshots taken with a physical iOS devices have "PNG" extension, and will never work until you change the extension. But screenshots taken on the iOS Simulator have extension "png" and work fine as is.
I've logged this in the Apple Bug Reporter as an XCode Usability issue:
17676619 Can't drag "PNG" to LaunchImages; only "png" works
Have you tried dragging the images straight from the Finder into the Asset Catalog? You shouldn't need to drag them into your project as an extra step first.
The other thing to check is that they are definitely PNG images; the Asset Catalog doesn't accept JPGs.
Had the same issue today. It happened only with a single image.
To solve it you have to re-save your image using a picture editor (Preview for Mac).
Launch Preview
Open your image
File -> Duplicate
Save it as another file
Drag and drop new file into asset catalog -> it works!
I was finally able to import the images. I must have messed something up prior, as I am certain that what I had to do should not have been necessary. But, in case anyone else runs into a similar dilemma:
I deleted the "LaunchImage" image set from the assets catalog
In the build settings, I changed the Asset Catalog Compiler Options to not have any image set named as the launch image.
In the assets catalog, I then created a new launch image set, using the context menu option "New Launch Image".
I was now able to successfully import both my images.
At this point, my app finally had a launch image - but it was the wrong one (i.e., 4 inch). This got fixed when I:
Changed the Asset Catalog Compiler Options (in the Build Settings) to again specify the "LaunchImage" as the launch image
catalog
FYI: I had previously tried adding a new launch image set, but had still never been able to import my images. It seems like the trick was to change the compiler options - but I have no idea why.
Not a substantially different answer, but just for someone who needs something more explicit, my images were saves as .jpg, which will not work. Open the photo editor of your choice and save as .png.
It’s back. In Xcode 10.2 dragging an image into an asset Catalog only works with one image. Then you need to close the project and open again to add another image.
They display in the catalog, but if you right click and Show in Finder, the image is not copied to the catalog folder. When you close and open only the first one remains.
I am working on some app icons and my understanding is that if the standard app icon is 57x57, then the retina display version of it is 114x114
But I am coming across some things that are named like this:
icon-114#2x.png
Is that a mistake? Or should that be there?
Thanks!
To add icons do this...
Put all your different icon images onto your desktop (or some folder that isn't part of the project).
Delete any icon images from your project.
Go to the project build summary page.
Drag each image to its respective slot.
Done.
You don't need to worry about names or anything. Xcode will rename them for you and copy them into your project.
Do I need to add the #2x version to the project in Xcode or will it know to find the #2x version in the folder?
You need to add the #2x version of the image to the project in Xcode. Remember to check the "Copy items into destination group's folder" box when adding the image. Also check your targets in the "Add to targets" menu. Think about it this way, if you don't add it to the project in Xcode, how will the image be found when it is deployed to actual devices of customers? They can't (obviously) connect remotely to your computer and download the #2x image. When customers with retina displays use your app and you don't include the #2x image in the project, the low quality image will be displayed.
In summation, YES. You must include the #2x version of the image if you wish to use a higher resolution image on retina devices.
Hope this helps!
It's quicker to just test it than to ask, but I don't think the image will be included in the bundle if you don't add it in Xcode.
It has to be part of the project, but when using the image, xcode will automatically pick the right one when referencing it.