objective c - Putting an ADBannerView on top of a UINavigationController -


i'm trying put iad banner in app based on uinavigationcontroller (it's not standard nav-base app proposed xcode, cause don't need table view). i'd place adbanner on bottom, visible, no matter how user pops , pushes views.

i studied iadsuite example in apple sample code, but, though it's reported among "best practices", don't think it's best practice need. declares adbannerview in app delegate class , implements adbannerviewdelegate methods every single view app needs. means implementing adbannerviewdelegate methods on , on again on every view controller class need! doesn't seem smart... :(

i'd rather prefer have approach more similar apple in tab bar based app, have part of window occupied tab controller , views switching above without affecting tab bar view below. can't directly put adbannerview along nav controller in app delegate, because adbanner needs placed in view controller (you runtime error otherwise).

i tried subclass uiviewcontroller, implementing adbannerviewdelegate in class, , place in rootviewcontroller along uinavigationcontroller i'm not having luck approach...

has found good, simple way to this? hint?

thank help...

you can have 1 class adbannerviewdelegate, , 1 instance of adbanner itself. when active view changes, remove adbanner old view, add subview new view.

edit:

to clarify, don't need each view implement adbannerviewdelegate. should have one class implement (that class doesn't have view controller matter).

you need maintain somewhere property point active view (e.g. can update property in navigation controller's navigationcontroller:didshowviewcontroller:animated:, or come own protocol if views appear in more complex way).

then in adbannerviewdelegate you'd resize view pointed current view property. actual view doesn't have know has ad in ;)


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -