Xcode 8.3.3 won't accept AppIcon - ios

When i try to drop PNG images for AppIcon in Assets.xcassets,
Placeholder: iPhoneApp iOS 7-10 60pt
Xcode does not accept these images. Images are PNG of right size 120x120(60x60#2x) and 180x180(60x60#3x), respectively.
If you have any suggestion please help.

According to the documentation, three parameters are important for the App Icon:
Format: all icon images must be in PNG format. Icon images may include an alpha channel but should not include any transparent regions.
The size: Here the base size is 60*60, so 120*120#2x and 180*180#3x.
Color model: It should be RGB.
You can check all these values with the Preview Inspector. In your case, the background of your icon is not visible in your screenshot (white or transparent?) so I would check for the transparency.
Also, I would double check the size. Some image editors tend to round the values and add 1px on one of the dimensions.

I resolved this.
Problem was that my files, although PNG images, did not have .png extension in file name. XCode did not recognize image format without extension, and did not show any warning.
After adding extension, everything start working properly.

Related

button image gets pixelated

I have designed a lock icon in Sketch to add to a button in my application:
I exported it both in pdf and png (2x, 3x) to add to Xcode assets. Problem is when I run the app on iPhone (SE), heavy pixelation can be seen around the edges of the icon:
I've tried both pdf and png formats, but result stays the same. Am I missing any settings that need to be applied for image to look sharp on screen?
Bigger is not necessarily better for a UIButton's image. Try to export your icon in more or less the same size with which it will be used. (Note that this also frees up memory in comparison to a way bigger image).
To adapt to different screens' resolutions, you should provide up to three images (#1x, #2x, #3x). You should read this excellent Apple's documentation on Image Size and Resolution. It explains perfectly how big should the images you provide in Xcode be.
They also have a good explanation on which format you should use according to the purpose of the image.
EDIT:
You can also use vector ressources (.pdf files for instance) that will render perfectly for any resolution. You can read this article about how to implement it in your Xcode project (If you do so, please be careful in the attributes of the asset to check Preserve Vector Data and the Scales to Single Scale, otherwise it may not render well).
It will happen if image sizes are not correct
check the size of images. 1x,2x and 3x sizes are should be as followed
1x = 24x24 px
2x = 48x48 px
3x = 72x72 px
If images size are too big than ImageView then pixelate will happen
Hope this will help you

What is appropriate size of icon for 3D Touch shortcut item on home screen?

I couldn't find it on Icon and Image Sizes.
But I mean, what is the size of following icons?
Below mentioned article, there is a note:
Once you download this, you will see that there is a recommended size:
104x104 for 3x
70x70 for 2x
Since Apple will automatically size and re-colour the icons, it's better to use a PDF, which has the added benefit of looking sharper and a reduced risk of causing clipped edges if margins aren't used.
Here's a comparison of PDF vs PNG (exact same icon, originally and SVG exported from Sketch):
The size is also the same.

WatchKit Force Menu Custom Icons Blurry

I'm creating custom icons for the WatchKit Force Menu. The documentation says to use an 80 x 80 size image with a drawing area of 54px square. All that works fine, but my image, when displayed in the button, looks very blurry compared to the built-in button images.
I'm creating them in Illustrator at 80px square. Saving as a .png image like the documentation says. Sizing is correct when saved at 72 dpi. If I do anything higher it causes the image in the button to be too large. I cannot find a way to scale the image.
Has anyone run into this? It seems like I would want to use a higher resolution image here or vector graphics.
You need to save the file with #2x in the filename to support retina displays.
So if your filename is myicon.png rename it to myicon#2x.png. In code you just use myicon for the name, Xcode automatically picks the correct size.
For iPhone 6, #3x is required...
I would recommend to use the Images.xcassets in Xcode for maintaining all images. There are templates for all needed resolutions (#1x, #2x, #3x, ...). Create the icons in these several resolutions and drag the files from finder to the placeholders. Later in your code you simply use the name of the image set in Xcassets.

Xcode generates png form pdf with different colors

We are following article to use pdf vector resources in iOS project: http://martiancraft.com/blog/2014/09/vector-images-xcode6/
However we faced problems. If we set color in Photoshop/Illustrator to #039AF0 then exported pdf will generate png with #1185ec color.
If we use old png way then colors are fine (please ignore pixelized image, the most important is color):
What can be the cause?
When a new artboard is created in Illustrator it defaults to using Adobe RGB for the color space which doesn't work well with iOS. To make sure the colors remain as close to the original as possible, set the color space to sRGB by selecting "Web" for Profile and RGB for Color Mode under Advanced.
This works well for new artboards. I have an Illustrator file as a deliverable that was created in Adobe RGB. For such cases, I've resorted to copy pasting vector paths on a new artboard that's set to sRGB before saving as PDF for use in Xcode 6.
I got the same problem, and finally I found that set the deployment Target to 7.0 or above solves the problem.
It is possible that Photoshop/Illustrator generates CMYK or other special colors in the PDF file and Xcode uses the PDF rendering engine that is implemented in iOS to convert the PDF files to PNG.
Because the iOS has problems with displaying CMYK colors, your PNG image has distorted colors.
The above is only an assumption because I have not seen a sample PDF file and the process used by Xcode to convert the PDF to PNG is not documented.

App icon displays a black square.

I am having my app icon be displayed as a black square instead of the intended image.
I have placed all of my AppIcons into the folder, Im wondering what could be causing this.
Your image needs to be an opaque PNG. No transparency or anything, as well as being the correct size.
If it already is that, try opening it in Preview and re-saving it as a PNG. That way OS X 'generated' it and it should be compatible. If that helps fix the issue, then your image editing program is saving in the wrong format...see info below.
Apple has this to say on generating PNGs:
For all images and icons, the PNG format is recommended. You should avoid using interlaced PNGs.
The standard bit depth for icons and images is 24 bits—that is, 8 bits each for red, green, and blue—plus an 8-bit alpha channel.
I have had this happen when the app is listed as a .png file, but the system is recognizing it as a .jpg or some other type ... find your icon in "finder" and open it with preview, go to the file menu select "export as" and make sure you choose PNG as the save format. Delete the old version in the application, delete the derived data, clean your project, and rebuild the application.

Resources