Swift - ADBannerView

前端 未结 3 724
眼角桃花
眼角桃花 2021-01-13 01:41

Hi guys I tryed to implement ADBannerView with the old way like Objective C but unsuccessfull. Everythings work but the advertisments didn\'t show up, it stays a blank field

3条回答
  •  春和景丽
    2021-01-13 02:11

    Mr. T answer contains a lot of useless code.

    All you need is this part to show ads in your controller:

    override func viewDidLoad() {
          super.viewDidLoad()
    
          canDisplayBannerAds = true
    }
    

    And when you don't need ads, you canDisplayBannerAds = false.

    What it does — wrapping your controller into another controller with ad banner at the bottom. This feature is available since iOS7.

    It's not possible to get delegate messages with it, so if you need it — you should replace it with ADBannerView instance variable.

提交回复
热议问题