Icon

Give the Hello, World! app an icon. Read Apple’s pep talk about icons. Now that Xcode 5.0 has asset catalogs, we can name the icon images whatever we want. We no longer need to use these filenames.

Source code in Hello.zip

  1. main.m
  2. Class HelloAppDelegate
  3. Class View
  4. Icon60x60@2x.png: 120 × 120 pixels.
  5. Default-568h@2x.png: 640 × 1136 pixels for 4-inch diagonal. The top 40 pixels are transparent for the status bar.
  6. Default@2x.png: 640 × 960 pixels. The top 40 pixels are transparent for the status bar.

Create the image files for the icons

For iPhone 5, create a 120 × 120 pixel png file. If you also want to support iPad and iPhone 4, you’ll need files of other sizes too. You could google for “iPhone icon” or copy your face out of the class photo. Convert the image to to PNG format, if necessary, using the Macintosh application Preview.app (which can also crop) or an online image converter. Or just use these unartistic files:
Icon29x29.png
Icon29x29@2x.png
Icon40x40.png
Icon40x40@2x.png
Icon60x60.png
Icon60x60@2x.png
Icon57x57.png
Icon57x57@2x.png
Icon72x72.png
Icon72x72@2x.png
Icon76x76.png
Icon76x76@2x.png
Icon50x50.png
Icon50x50@2x.png
iTunesArtwork.png
iTunesArtwork@2x.png

Save the image files (at least the 120 × 120) on your Mac desktop.

Add the image files to the project

In the Xcode Project Navigator, select the asset catalog file Images.xcassets. We will remove the existing AppIcon and add a new one, in order to have the opportunity of giving the app a full set of icons of different sizes. Select AppIcon and pull down
Editor → Remove Selected Items.
Editor → New App Icon
Drag the images from the desktop into the squares in Xcode. See these directions.

Run your project. Then press the iPhone Home button on the simulator and you should see your icon. If you pull down the Simulator’s Hardware menu and select a different device, your app may get an icon with a different size.

I made the sixteen .png files with the Netpbm library.

I made the above .png files by running this shellscript on my Unix machine i5.nyu.edu.

Things to try

  1. Give your app at least one icon, the 120 × 120 for iPhone 5.

  2. The purpose of a launch image is to fool the user into believing that the app is already running.
    IBM:
    IBM: 184.42

    Name the launch images Default@2x.png (640 × 960) and Default-568h@2x.png (640 × 1136, for the 4-inch diagonal retina R4) and add them to the project.

    I created the launch images in this app with this shellscript. The top 40 pixels are transparent to avoid blocking the status bar.