I added iAd banner in my app, and the code is like this:
@IBOutlet var adBannerview: ADBannerView?
and codes that in viewDidLoad
:
self.canDisplayBannerAds = true
self.adBannerview?.delegate = self
self.adBannerview?.hidden = true
then:
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
func bannerViewWillLoadAd(banner: ADBannerView!) {
}
func bannerViewDidLoadAd(banner: ADBannerView!) {
self.adBannerview?.hidden = false
}
func bannerViewActionDidFinish(banner: ADBannerView!) {
}
func bannerViewActionShouldBegin(banner: ADBannerView!, willLeaveApplication: Bool) -> Bool {
return true
}
func bannerView(banner: ADBannerView!, didFailToReceiveAdWithError: NSError!) {
self.adBannerview?.hidden = true
}
}
Now, my app is sale on app store, I downloaded that, but when I open it, found there's no ads on the bottom, is that something wrong with my code? But when I run the app on simulator, it says "Connected to iAd". Appreciate if you help!