I am facing a weird problem with iAds banner not showing on Xcode 7.1.1 and iOS 9/9.1. On previous versions it was showing correctly.
Things i have already tried to fix the issue:
1). I tried reinstalling the iAd Framework.
2). I tried creating a new project on a different mac machine.
3). I tried changing the deployment target version from 9.0 to 8.0.
4). I tried all the example projects on Github on iAd.
They all fail to show the apple default advertisement.
Code as below:
import iAd
class PlayViewController: UIViewController, ADBannerViewDelegate, UITableViewDataSource, UITableViewDelegate {
@IBOutlet var bannerView: ADBannerView?
override func viewDidLoad() {
super.viewDidLoad()
self.canDisplayBannerAds = true
self.bannerView?.delegate = self
self.bannerView?.hidden = true
}
func bannerViewDidLoadAd(banner: ADBannerView!) {
self.bannerView?.hidden = false
print ("iAd success")
}
func bannerView(banner: ADBannerView!, didFailToReceiveAdWithError error: NSError!) {
self.bannerView?.hidden = true
}
}