is it a good practice to delete the AdBannerView on viewWillDisappear and add it back on viewWillAppear?

前端 未结 2 810
面向向阳花
面向向阳花 2020-12-18 13:21

I am currently doing the following in my code avoid the issue of \"obscured\" ad. But is it a good practice? One potential problem is that - assume before the viewWillDisapp

2条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-18 14:09

    Out of interest, why is that you are removing the ADBannerView?

    Apple state that you should share the ADBannerView instances across views.

    From the docs: "If your application has multiple tabs or views displaying an iAd banner, be sure to share a single instance of ADBannerView across each view."

    i.e. Apple think you should have the ADBannerView presented at the top/front of your view hierarchy and just move it off-screen when there is no ad to show.

    So, to answer the question, "is it bad practice to remove and then add it again?" yes, Apple would say it is.

提交回复
热议问题