I have been learning a lot about writing Objective-C code and designing in Interface Builder and I wanted to set icons for my simple programs.
I added the same JPG to all the size fields in Icon Composer and got an ICNS, but I couldn't figure out how to add it to the project.
Thank you in advance.
On your Mac, select the file or folder. Choose File > Get Info in the menu bar. At the top of the Info window, select the small custom icon. Make sure you click the small icon at the top of the Info window (not the large icon under Preview).
Alternatively, right-click the application and select 'Get Info. ' Now click once on the app's icon in the top left corner of the Info panel to highlight it. Next, press ⌘C on the keyboard – this will copy the icon's graphics to the system clipboard.
Change the Default App Icon SetIn the Project navigator, select the project and in the project editor, select the target. In the “App Icons and Launch Images” section of the General pane, choose the app icon set from the App Icons Source pop-up menu.
Since Xcode 4.4 Icon Composer is no longer the recommended way to create icons and is no longer included in the standard install of Xcode. Due to the introduction of Macs with retina display, it is now recommended to provide high resolution versions of all graphics including app icons.
To give your app an icon under Xcode > 4.4 do the following:
Create a folder [IconName].iconset in Finder
In this folder place your icon as png files. You'll need the icon in sizes of 16px, 32px, 64px (retina only), 128px, 256px, 512px and 1024px (retina only)
These icons must be named with the pattern icon_16x16.png, icon_32x32.png, icon_128x128.png and so on
To support retina displays you must also add icon files with double resolution, named [email protected] (with size 32x32), [email protected] (size 64x64) and so on up to [email protected] (size 1024x1024).
drag this [IconName].iconset folder to Xcode (copy if necessary)
in the info.plist file set the "CFBundleIconFile" (Icon File as Key) value to [IconName] but without the .iconset extension
Annotations:
Update: In the end your .iconset folder has the following 10 items:
icon_16x16.png [email protected] icon_32x32.png [email protected] icon_128x128.png [email protected] icon_256x256.png [email protected] icon_512x512.png [email protected]
Official guide:
https://developer.apple.com/library/content/documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/Optimizing/Optimizing.html
To convert the iconset folder to an icns file, run the following command on the terminal:
iconutil -c icns [IconName].iconset
where [IconName] should be replaced with the prefix of the iconset folder. You now have a file called [IconName].icns. In Xcode 4.4, in the Target Summary, right click the question mark for the icon, then select the icns file. You should then see the question mark get replaced with the icon.
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