I've used the same code on all my apps to display iAd ads, but after downloading xcode 7 and converting my code to swift2, ads don't appear anymore on my device or on the xcode simulator. Does anyone know what changes need to be made?
import UIKit
import SpriteKit
import iAd
class GameViewController: UIViewController, ADBannerViewDelegate {
var adBanner: ADBannerView? = ADBannerView()
override func viewDidLoad() {
super.viewDidLoad()
adBanner?.delegate = self
adBanner?.hidden = true
self.canDisplayBannerAds = true
}
func bannerView(banner: ADBannerView!, didFailToReceiveAdWithError error: NSError!) {
adBanner?.hidden = true
}
func bannerViewDidLoadAd(banner: ADBannerView!) {
adBanner?.hidden = false
}
func bannerViewActionShouldBegin(banner: ADBannerView!, willLeaveApplication willLeave: Bool) -> Bool {
return willLeave
}
}