For anyone who's interested, it was nice and easy getting this setup. I've included what I did below for a portrait only application which fades the ad banner in when it's available and out when it's not.
1) Edit SPViewController.h to import iAds
#import <iAd/iAd.h>
2) add iAd delegate to SPViewController.h
@interface SPViewController : GLKViewController <ADBannerViewDelegate>
3) add iAd initialisation code to SPViewControler.m ViewDidLoad
// iAds Startup
adView=[[ADBannerView alloc] initWithFrame:CGRectZero];
adView.delegate=self;
adView.requiredContentSizeIdentifiers = [NSSet setWithObject:ADBannerContentSizeIdentifierPortrait];
adView.currentContentSizeIdentifier=ADBannerContentSizeIdentifierPortrait;
// put ad at bottom of screen
CGRect adViewFrame = adView.frame;
adViewFrame.origin.y = self.view.frame.size.height-adView.frame.size.height;
adView.frame = adViewFrame;
adView.alpha=0; // hide ad until ready
[self.view addSubview:adView];
4) Add the delegate methods to SPViewControler.m to fade the adds in/out when available
#pragma mark - handle iAd Delegate Methods
// iAd has been loaded ok
-(void)bannerViewDidLoadAd:(ADBannerView *)banner {
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1];
[banner setAlpha:1];
[UIView commitAnimations];
}
// iAd failed to load
-(void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error {
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1];
[banner setAlpha:0];
[UIView commitAnimations];
}
That's it. All works perfectly.