As the iAd framework notifies us when no adverts are available, we can use this delegate method to display an alternative banner, namely, a simple image.
1. We'll continue with our demo iAd app that we created in the last chapter; open it in Xcode now. For our banner, we'll use an image that is the same size as an iAd banner, 320px wide and 50px high, but we'll also require a high-resolution, double-sized image for retina displays. In the
iAd Demo App
folder included with the book resources, locate the images[email protected]
andBanner.png
to the project navigator, that is, to the left of Xcode.Note
Unlike iAd Producer, Xcode doesn't automatically produce our low-resolution images from the high-resolution versions. We need to create one image at 640px by 100px and then save another version at half the size. You can use Preview to edit, resize, and save each banner. Name your high-resolution image with
@2x
in the filename before the file extension.2. With...