I've made two iPhone apps using Swift and just implemented the iAd Framework and added self.canDisplayBannerAds = true
in my viewDidLoad()
under GameViewController()
.
When ads appear in my game, the game screen resizes so that everything is still visible. When this happens, the game screen gets shrunken vertically and the game becomes much harder for the player.
How can I overlay the banner ad onto the bottom of the screen without resizing the game screen? I want the bottom part of the game screen to simply not be visible.
As far as I know the issue is in the
self.canDisplayBannerAds = true
This code worked perfectly for me! Please make sure, that you name your AdBannerView "adBanner" ( var adBanner = ADBannerView()
)
Include this code in viewDidLoad
adBanner = ADBannerView()
adBanner.frame = CGRectZero
adBanner.delegate = self
self.adBanner.frame = CGRectMake(0, self.view.frame.size.height-self.adBanner.frame.size.height, self.adBanner.frame.size.width, self.adBanner.frame.size.height)
adBanner.backgroundColor = UIColor.clearColor()
self.view.addSubview(adBanner)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With