0
votes

I am a Apple developer that used to work with UIImages and photography. Now I am entering int the Table/List problems and having some trouble.

I need to implement a system that shows up a lot of views, separated by contexts (see the UITabBarItems below). One of this views is a list of places, separated by categories. Every list has its banner. I tried to put on my main window a tabbarcontroller that includes 3 viewcontrollers and the one that shows the categories . It's a navigationcontroller. The problem is: I can't control the ads this way!

Does someone know what can i do?

SEE MY MOCKUP

In short, I want to allow to put an image over a UINavigationController, like this:

what i want to do

2

2 Answers

1
votes

If you create and use a subclass of UINavigationController you can add a custom ad as a subview.

Then, you can set the height of the tableview footer to be the same height as your ad if your ad is over the tableview, so the tableview ends at the top of the ad.

This is how I have ads via the MobClix framework set up in an app.

0
votes

One option is to add it as a subview to your subclass of UITableViewController. If the ad is different depending on the category you could pass it on before pushing another view controller into the navigation stack. Or you could use a delegate pattern to ask the parent view controller what ad it should be displaying.

A better option which takes more effort, is to actually use a subclass of UIViewController which implements UITableViewDataSource and UITableViewDelegate protocols and put a tableview inside it. Now you can resize your tableview to accommodate the ad banner. That way you can avoid some items remaining hidden behind your banner.