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?