Reputation: 373
I followed the instructions provided here in order to share iAd content amongst multiple VCs:
How to create a global reference for iAd and implement in multiple Viewcontrollers
However I now want to be able to hide the banner if there's no advert and reveal when one is available. I've seen coding for how to do this in a specific VC by making it an ADBannerViewDelegate and implementing a couple of delegate methods that show/hide using an animation block.
My question is - would I make each discrete VC an ADBannerViewDelegate and add the delegate methods to each one, or in the spirit of the linked-to Q&A, is it possible to have just a single ADBannerViewDelegate and implement the delegate methods once?
Thanks Tony.
Upvotes: 0
Views: 933
Reputation: 6259
Both are possible and permissible.
Having a single delegate with methods that cover all cases is generally a more elegant solution than making each ViewController its own delegate for the ADBanner.
Which is best for you depends on your existing code and how easily you can abstract the desired ad behavior to work across several ViewControllers.
Upvotes: 1