20.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 and background@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. I will list only the retina images, so please divide the image width and height that I provide below in half to get the dimensions of the non-retina images:

background@2x.png

640 pixels wide and 960 pixels tall

logo@2x.png

60 pixels ...

Get iOS 6 Programming Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.