I'm trying to get ADBanner
at the bottom above UITabBarController / float above UITabBarController
as I'm using PFQueryTableViewController
I'm getting the ADBanner as a part of TableViewCell
and the ADBanner is scrollable like the table.
And as I'm using PFQueryTableViewController
I can't add view to my table .
as it is scrollable .
The following code I'm using inside viewDidLoad
method
let bannerView: GADBannerView = GADBannerView(adSize:kGADAdSizeSmartBannerPortrait)
bannerView.frame.origin = CGPointMake(0, self.view.frame.size.height - 49 - 50)
bannerView.adUnitID = "ca-app-pub-5819113245629378/9884937047"
bannerView.rootViewController = self
self.view.addSubview(bannerView)
bannerView.loadRequest(GADRequest())
Update: This is how I'm adding the containerView.
Now the containerView is not visible
PFQueryTableViewController
is a subclass ofUITableViewController
, So if you add any subview to its view whites a tableview will float based on the content of its tableview;You can try by adding it a view controller instead table view. But in your case it is
PFQueryTableViewController
, My opinion is to add one view controller and add an embedded view controller segue to yourPFQueryTableViewController
.. Then add your banner to your first view controllerUPDATE
If you are using storyboard, you can try as follows. Also try to use auto layout instead of fixed frame.