O'Reilly logo

iOS 7 Programming Cookbook by Vandad Nahavandipoor

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

23.3. Providing Icons and Images for Passes

Problem

You want to make sure that your pass will be branded according to your company’s style, or give your pass a distinct flavor or image.

Solution

Create backgrounds, icons, and logos and embed them inside your digitally signed pass.

Discussion

A pass can contain different images:

Background (background.png, background@2x.png, and background-568@2x.png)

The background image of the pass. Not all passes can have background images.

Logo (logo.png and logo@2x.png)

The logo that will appear on the upper-left corner of the pass, depending on which type of pass it is.

Icon (icon.png and icon@2x.png)

The icon for the pass. Not all passes can have icons. We will have a look at creating icons for passes in this chapter.

Thumbnail (thumbnail.png and thumbnail@2x.png)

The thumbnail image that will be visible when the passes are stacked on top of each other.

All images, as you can see from the filenames, have to come in the non-Retina and the Retina flavors. Apple doesn’t strictly say that this is a must, but don’t we all as developers value our customers? Retina displays are so popular now that they are becoming industry standard, so please do provide the Retina images for your passes.

Now that we know the image filenames, let’s move on to the image dimensions. In the following, I list only the Retina images, so to get the dimensions of the non-Retina images, please divide the image width and height in half:

background@2x.png

640 pixels wide and 960 pixels tall ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required