2016-12-28 47 views
-1

這是我第一次使用iAd並希望在UICollectionView的每5個單元格中顯示它。我有兩個小區的一個正常,一個用於IAD,我已連接代表對IAdCell和裁判ADBannerViewDelegateiAd UICollectionView每5個單元格

在viewDidLoad中()我有self.canDisplayBannerAds =真

在UICollectionView我使用此代碼決定我想要的細胞回

覆蓋FUNC的CollectionView(的CollectionView:UICollectionView,cellForItemAtIndexPath indexPath:NSIndexPath) - > UICollectionViewCell {

let isBanner = movies[indexPath.row].TmdbId == nil 
    if(isBanner){ 
     let cell = collectionView.dequeueReusableCellWithReuseIdentifier("iAdCell", forIndexPath: indexPath) as! IAdCell 

     return cell 
    } 

    let cell = collectionView.dequeueReusableCellWithReuseIdentifier(reuseIdentifier, forIndexPath: indexPath) as! LatestMovieTVCell 

    return cell 
} 

細胞看起來像這樣

進口的UIKit 進口的iAd

類IAdCell:UICollectionViewCell,ADBannerViewDelegate {

@IBOutlet var IAdBanner: ADBannerView! 

override func awakeFromNib() { 
    super.awakeFromNib() 
    IAdBanner.hidden = true 
} 

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

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

}

但似乎不顯示廣告是空

感謝 本尼

回答

0

蘋果關閉iAd網絡:

https://developer.apple.com/support/iad/

啓動2016 7月1日,iAd的將不再是供開發者通過運行iAd的銷售廣告獲得收入或促進其應用在IAD應用網絡。

所有iAd.framework東西都已棄用。這就是爲什麼你沒有看到任何東西。

已實施已棄用的iAd.Framework類的應用程序不應僅因爲棄用而崩潰。在下次常規應用程序更新或提交時,您應該刪除iAd框架和連接。

相關問題