larsacus / LARSAdController

Lightweight ad mediation for iOS to properly manage multiple ad networks dynamically including iAd and Google ads.
http://theonlylars.com/blog/2013/01/10/stupid-easy-ads-with-larsadcontroller-3-dot-0/
MIT License
269 stars 60 forks source link

LARSAdController Delegates #58

Closed robmontesinos closed 10 years ago

robmontesinos commented 10 years ago

I am trying to place an Ad Banner at the bottom of a view which happens to have a Toolbar at the bottom. I have a total of about 12 view controllers to implement Ad Banners on.

I would like to know how I would know to resize my subviews to accommodate the AdBanner if it is loaded and leave the subviews in their original frames if the Ad Banner is not loaded.

I can't really use the delegate methods in each view controller since this will make for multiple delegates for the LARSAdController. I don't feel that NSNotificationCenter is the way to go but it might be. KVO?

I see that you have properties for parentView and parentViewController as well as the flag for adVisible. If the user is flying through different screens, what strategy would you suggest for proper sizing and re-sizing of the subViews? I've been scratching my head all day with this dealio. Thank you in advance.

larsacus commented 10 years ago

You'll use KVO to observe changes in the adVisible property. I've made a string constant specifically for this purpose:

NSString * const kLARSAdObserverKeyPathIsAdVisible;
robmontesinos commented 10 years ago

Thank you very much!