I’m building an app for a blog site.
I have a UINavigationController with a UITableViewController as it’s root view.
I laid this out in a storyboard no problem, but I’m trying to drag an iAd view to the bottom of the screen and xcode will not let me add it.
It looks like I have to switch from a subclass of UITableViewController to a subclass of UIViewController, and just put my delegate and datasource methods in my subclassed UIViewController.
This seems wrong to me. I’m just trying to end up with a UITableView of article headlines, with a navbar up top, and an iAd at the bottom…
Advice? Suggestions?
Thanks in advance.
One of the easiest ways to accomplish this is using the
UITableView‘stableFooterViewproperty. Yes, I know the footer stays at the bottom of the table, but it doesn’t have to. You can set its frame within the table. Add the iAd as the footer like so:Then, to adjust the frame of the iAd as the table scrolls, implement the
UIScrollViewdelegate method: (This is possible becauseUITableViewis a subclass ofUIScrollView)You can see that the implementation is easy enough. We simply use the
contentOffsetyto determine how far down the frame of the iAd should be.