Hide ads on multiple view controllers?

My app has a Tab Bar Controller and two view controllers. The app shows ads on both view controllers in a GADBannerView at the bottom. I am using swifty store kit to do in app purchases. The problem is how do i hide the ads on all view controllers?

hi @summey,
one simple way is to have a flag called showAds and set it to true, then check if the user has purchased to remove the ads, if the user has, that will set the value to false. Now in the code where you fetch the ads, only fetch if the showAds is true.

If you purchase the removal of ads then at the end of a successful purchase, set the flag to false and the AD’s would have a view context, in there set it to hidden or remove it from the superview. Look at the GADBanner SDK for more details.

cheers,

cheers,