title: How to hide admob adverts using Swift?
body: <p>I am adding in-app purchase to my game built on Swift. I do not know objc very much let alone Swift, so this is all a learning experience for me. I have added in app purchases and adverts, now i am trying to confirm the purchase, and then remove the admob ads. </p>
  
  <p>Here is my current view controller:
  <a href="http://pastebin.com/t5KVvn6H" rel="nofollow">http://pastebin.com/t5KVvn6H</a></p>
  
  <p>I am trying to use something like to check if the purchase is complete:</p>
  
  <pre><code>if NSUserDefaults.standardUserDefaults().boolForKey("noAds") {
  }
  </code></pre>
  
  <p>What I am wondering is, I put that in the <code>viewDidLoad</code>, right? Ok, now the part I need help with, what is the to put inside to hide the ads. I read I can use:</p>
  
  <p><code>admobBannerView.removeFromSuperView()</code> but have on idea how to work with it in syntax or how to create instances. Any help would be greatly appreciated!</p>
  
  <pre><code>// Remove Ads
      if NSUserDefaults.standardUserDefaults().boolForKey("noAds") {
          ADBannerView().removeFromSuperview()
          GADBannerView().removeFromSuperview()
          admobBannerView.removeFromSuperview() &lt;--- gives me error: use of unresolved identifer admobBannerView
      }
  </code></pre>
  
  <p>admobBannerView is being referenced in ViewController. I am really newb. </p>