O'Reilly logo

iAd Production by Ben Collier

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

Time for action — you spin me right round

If you're using the demo app, then let's enable all the possible orientations. Make sure our banner adjusts itself accordingly:

  1. Open the demo app in Xcode. If you're using your own app that already supports multiple orientations, skip ahead to step 4.
  2. To enable our app to know it should spin the view when the device is rotated, we need to modify a simple bit of Objective C. Open the file iAd_Demo_AppViewController.m from the project navigator; you'll see the code appear on screen. Find the method (BOOL)shouldAutorotateToInterfaceOrientation, which should be near the end of the function. This is called by the device when it's rotated and we're able to tell it when it should and shouldn't update the view. ...

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