tags:

views:

83

answers:

2

Apple's documentation on the UIViewController class has this to say:

Note: You should not use view controllers to manage views that fill only a part of their window—that is, only part of the area defined by the application content rectangle. If you want to have an interface composed of several smaller views, embed them all in a single root view and manage that view with your view controller.

When using iAd, this is a pain. The problem is that I don't want to be managing my app's content in the same class that has methods like moveBannerViewOffScreen, didFailToReceiveAdWithError, etc. Putting those in the same class reduces modularity. Additionally, I can't have a navigation stack in which the ad remains in place when other view controllers are pushed.

I am curious if readers have encountered similar issues and if so, how you have dealt with them?

A: 

If you want modularity while keep using ivars from the view controller, create a category.

KennyTM
But the banner view and the app logic both need their own ivars. Also it feels awkward to be calling category methods in viewDidLoad.
William Jockusch
A: 

The two approaches that come directly to mind are using a non-UIViewController class as your delegate, or using a subclass of UIViewController as your view controller base class and putting the logic in there.

Seamus Campbell