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.
main.m
HelloAppDelegate
View
Icon60x60@2x.png
:
120 × 120 pixels.Default-568h@2x.png
:
640 × 1136 pixels for 4-inch diagonal.
The top 40 pixels are transparent for the status bar.Default@2x.png
:
640 × 960 pixels.
The top 40 pixels are transparent for the status bar.
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:
iTunesArtwork.png
|
iTunesArtwork@2x.png
|
Save the image files (at least the 120 × 120) on your Mac desktop.
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 above
.png
files by running
this shellscript
on my Unix machine
i5.nyu.edu
.
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.