Recently, I incorporated iAds into one of my apps and found it puzzling that there were no quick 5 minute guides on how to do this with storyboards. Apple provides some great example code for XIBs, but it won't work out of the box with storyboards. Apple suggests using a single iAd instance throughout the app. If you have multiple instances, it may harm your iAd revenue and end user performance. Secondly, you want to hide the iAd view when there's no ad to display.
This short tutorial will get you going with iAd storyboard integration in 5 minutes flat. We'll use the code from one of Apple's examples, tweak it a little to properly load from a storyboard, and subclass our storyboard views. This tutorial assumes you're using a tabbed app (UITabBar). Easy stuff. Let's begin.
- Link the iAd.framework to your target.
- Grab the the modified BannerViewController class (.h|.m) from the demo project and import it into your own project. initWithCoder and making it work with auto layout were the core changes.
- Subclass your UIViewControllers to be BannerViewControllers.
- You're all done. Launch the app in the simulator or on your phone and wait a few seconds for the ad view to appear.
If you're having any trouble, take a look at the demo project I pieced together.