Search code examples
iosios8iadadbannerview

Does canDisplayBannerAds only use a single instance of an iAd Banner?


I am creating an iOS8 application and started to implement iAd's Banner in code, but yesterday I discovered that I can use the canDisplayBannerAds property. I enabled it on each of the views in my application, and it is working. Previously, when I was implementing it with my own code, there was a lot of discussion about the importance of using a singleton of the ADBannerView. Does canDisplayBannerAds use a singleton, or is it violating what I had read about the importance of using a singleton? Does it really matter from a performance, advertising, and Apple Store perspective?

Thank you for your comments and feedback,

Mike


Solution

  • No, it uses a new one each time. I ran into that problem when first using iAd. Each vc had canDisplay... And the ads got all messed up. In fact they didn't even show up in the App Store version. Best to use either the singleton method or something similar that reuses the iAd. I myself use the app delegate. All my apps use that and I have not run into any problems at all. Good luck!

    EDIT#1

    Here is a link to a blog post I wrote using iAd with the app delegate. It is written in Objective-C but at least you will get the general idea. I basically create an iAd banner in the app delegate and then use that one in every vc you need.