title: Show adMob banners only in specific scenes; Swift
body: <p>In my game I got 4 different Scenes.
  Now I want to ad some AdMob banners, but just in 2 of these 4 scenes.</p>
  
  <p>I tried it like this. </p>
  
  <pre><code>class GameViewController: UIViewController, GADBannerViewDelegate {
  
  
  var bannerView: GADBannerView!
  
  
  
  override func viewDidLoad() {
  
      super.viewDidLoad()
  
  
      if let view = self.view as! SKView? {
          // Load the SKScene from 'GameScene.sks'
  
          if var scene = StartScene(fileNamed: "StartScene") {
  
  
  
  
  
              // Set the scale mode to scale to fit the window
              scene.scaleMode = .aspectFill
  
              // Present the scene
              view.presentScene(scene)
  
  
  
          }
  
  
  
          if var scene = MainMenuScene(fileNamed: "MainMenuScene") {
  
  
  
          bannerView = GADBannerView(adSize: kGADAdSizeBanner)
  
          self.view.addSubview(bannerView)
          let request = GADRequest()
          request.testDevices = [kGADSimulatorID]
          bannerView.rootViewController = self
          bannerView.delegate = self
          bannerView.adUnitID = "ca-app-pub-2567181742111069/9977523039"
          bannerView.load(request)
          bannerView.center = CGPoint(x: 329, y: 350)
  
          }
  
  
          view.ignoresSiblingOrder = true
  
          view.showsPhysics = false
  
  
          view.showsFPS = false
          view.showsNodeCount = false
  
  
  
        }
  
  
  
  }
  </code></pre>
  
  <p>The problem is, that the ads are still shown in every Scene. </p>
  
  <p>Does anybody know how to solve this problem?</p>