2016-12-28 49 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框架和连接。

相关问题