Reputation: 672
So I am trying to have multiple(five actually)iAd banners in one view controller, and have them animate up from the bottom in succession as they each receive an add. I am trying to figure out the best way to implement this. Since they are all in one view controller, I have the delegate for each set to self, so they all call - (void)bannerViewDidLoadAd:(ADBannerView *)banner
and I have worked with iAds before, and with only one banner, I usually offset it from the bottom of the screen and then do this
-(void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error
{
if (self.bannerIsVisible)
{
[UIView beginAnimations:@"animateAdBannerOff" context:NULL];
//Assumes the banner view is placed at the bottom of the screen.
banner.frame = CGRectOffset(banner.frame, 0, banner.frame.size.height);
[UIView commitAnimations];
self.bannerIsVisible = NO;
}
}
but obviously banner cannot refer to all the banners at the same time,so how would I do this? Could I just use the property for each of them in this same way? I did try that, but it did not seem to be working.
And also, this is for a joke, and my personal desire to figure this out, in case you are wondering why I want five ad banners on one view.
Thanks!
Upvotes: 1
Views: 255
Reputation: 97
It's possible that having multiple iAd instances pointing to the same delegate is forbidden in the eyes of the framework so it might be best if you create a single view controller that implements the iAd delegate methods for each iAd you want to show then just add each viewcontrollers subView to your main view which is showing all the ads.
Upvotes: 1