Hide iAds programmatically on iPhone

I am currently displaying iAds in my application. They work great. Now I want to hide iAds based on some conditions in the code.

What I use

ADBannerView *bannr= (ADBannerView *)[self.view viewWithTag:1];

bannr.hidden = YES;

bannr.userInteractionEnabled = NO;

iAds get hidden.But when I click the area where the iAd should be. Ad Details Details Window

+3
source share
2 answers

With my iAds, I switch them to or after the screen after the corresponding callbacks have been received by the delegate.

This works for me well.

Hope this helps Good luck,

0
source

Since it ADBannerViewis a subclass UIView, you can remove it with removeFromSuperview.

[bannr removeFromSuperview];

, , .

Update

: , :

- (BOOL)bannerViewActionShouldBegin:(ADBannerView *)banner willLeaveApplication:(BOOL)willLeave {
  if (banner.isHidden) {
    return NO;
  }

  // Business as usual
}
0

Source: https://habr.com/ru/post/1777028/


All Articles