How to share iAd banner between views using AppDelegate

末鹿安然 提交于 2019-12-05 12:20:50

in line

self.appDelegate.adBannerView = ADBannerView(frame: CGRect.zeroRect)

you are creating a new ADBannerView instance and throwing away the old one. So you are not sharing the view object, just the variable. Remove this line. After you've done this,

self.appDelegate.adBannerView.delegate = nil

does not make any sense, because you're setting it to self later. Remove it, too.

See also https://developer.apple.com/library/ios/technotes/tn2286/_index.html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!