I have successfully implemented iAd in Swift, except when an ad appears, it reconfigures the dimensions of self
. How do I make it such that the ad appears in front of the screen, and doesn't alter the size of the screen?
This is the code I used:
class GameViewController: UIViewController, ADBannerViewDelegate {
var bannerView:ADBannerView?
override func viewDidLoad() {
super.viewDidLoad()
super.viewDidLoad()
self.canDisplayBannerAds = true
self.bannerView?.delegate = self
self.bannerView?.hidden = true
}
func bannerViewDidLoadAd(banner: ADBannerView!) {
self.bannerView?.hidden = false
}
func bannerViewActionShouldBegin(banner: ADBannerView!, willLeaveApplication willLeave: Bool) -> Bool {
return willLeave
}
func bannerView(banner: ADBannerView!, didFailToReceiveAdWithError error: NSError!) {
self.bannerView?.hidden = true
}
}
How do I make it such that the ad appears in front of the screen, and doesn't alter the size of the screen?