Add ADBannerView to the footer of UITableViewController doesn't appear
-
29-04-2021 - |
Question
I have UITableViewController I want to add ADBannerView to its footer
so I added the framework iAd.framework , and tried the following code
- (void)viewDidLoad {
[super viewDidLoad];
ADBannerView* adView = [[ADBannerView alloc] initWithFrame:CGRectZero];
adView.frame = CGRectOffset(adView.frame, 0, -50);
adView.requiredContentSizeIdentifiers = [NSSet setWithObject:ADBannerContentSizeIdentifier320x50];
adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifier320x50;
[self.tableView.tableFooterView addSubview:adView];
}
But it doesn't appear.
am I missing something or what
Best regards
Solution
That's not going to work. You'll have to implement the datasource method called tableView:viewForFooterInSection: and return the adbanner view. You might also have to implement the delegate method tableView:heightForFooterInSection:
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow