0

So I have this code.

override func viewDidLoad() {
    super.viewDidLoad()

    self.canDisplayBannerAds = true
    adBanner.delegate = self
    adBanner.hidden = true 
}

func bannerView(banner: ADBannerView!, didFailToReceiveAdWithError error: NSError!) {
    NSLog("adBanner Error")
}

func bannerViewWillLoadAd(banner: ADBannerView!) {

}


func bannerViewActionShouldBegin(banner: ADBannerView!, willLeaveApplication willLeave: Bool) -> Bool {
    return true
}

func bannerViewDidLoadAd(banner: ADBannerView!) {
    adBanner.hidden = false
}

It works fine but when I transition to one of my other view controllers, then go back, the adBanner is visible but empty for x amount of time (say maybe 15 seconds) before loading a new ad. How can I tell the adBanner to become hidden again until the new ad is loaded?

Daniel Storm
  • 18,301
  • 9
  • 84
  • 152
ElectricTiger
  • 111
  • 1
  • 9
  • What you're looking for is a Shared Banner to use across your entire application http://stackoverflow.com/questions/28514758/swift-iad-more-than-10-instances-of-adbannerview-warning-and-cgaffinetransform/28639200#28639200 – Daniel Storm Apr 22 '15 at 12:19
  • Move your code from viewdidload to viewwillappear and then check. – aBilal17 Apr 24 '15 at 11:38

0 Answers0