title: iAd's with Swift in SpriteKit
body: <p>I am working on an app and would like to include iAd's. I have managed to add banner ad's and they work well. However i want to a larger add that fills most of the screen but not full screen. I added the adBanner using code from <a href="https://stackoverflow.com/questions/24771295/iad-in-xcode-6-with-swift">Benzene's Question and given solution from erdekhayser.</a></p>
  
  <p><a href="https://developer.apple.com/iad/resources/Implementing-iAd-in-Your-iOS-Apps.PDF" rel="nofollow noreferrer">Apple iAd Documentation (Page 3)</a></p>
  
  <p>The link i have referenced above is from the apple documentation and apple refer to the iAd as an MREC ad. This is what i would like to have. I cannot work out how to create and add one though. I have tried resizing the adBanner but still cannot figure it out.</p>
  
  <p>Any help would be appreciated</p>
  
  <p>This is the code i have so far: </p>
  
  <pre><code>import UIKit
  import SpriteKit
  import iAd
  import Twitter
  
  var adBannerView: ADBannerView!
  
  class GameViewController: UIViewController, ADBannerViewDelegate {
  
  var scene: GameScene!
  
  func loadAds() {
  
      adBannerView = ADBannerView(frame: CGRectZero)
      adBannerView.delegate = self
      adBannerView.hidden = true
      view.addSubview(adBannerView)
  }
  
  override func viewDidLoad() {
      super.viewDidLoad()
  
          // Configure the view.
          let skView = view as SKView
          skView.showsFPS = false
          skView.showsNodeCount = true
          skView.showsPhysics = false
  
          /* Sprite Kit applies additional optimizations to improve rendering performance */
          skView.ignoresSiblingOrder = true
  
          /* Set the scale mode to scale to fit the window */
          scene = GameScene(size: skView.bounds.size)
          scene.scaleMode = .AspectFill
  
          skView.presentScene(scene)
  
          //iAd
          loadAds()
  
  
  
  }
  
  //iAd
  func bannerViewWillLoadAd(banner: ADBannerView!) {
  
  
      println("Ad about to load")
  
  }
  
  func bannerViewDidLoadAd(banner: ADBannerView!) {
  
      adBannerView.center = CGPoint(x: adBannerView.center.x, y: view.bounds.size.height - view.bounds.size.height + adBannerView.frame.size.height / 2)
  
      adBannerView.hidden = false
      println("Displaying the Ad")
  
  }
  
  func bannerViewActionDidFinish(banner: ADBannerView!) {
  
  
      println("Close the Ad")
  
  }
  
  func bannerViewActionShouldBegin(banner: ADBannerView!, willLeaveApplication willLeave: Bool) -&gt; Bool {
  
      //pause game here
  
  
      println("Leave the application to the Ad")
      return true 
  }
  
  func bannerView(banner: ADBannerView!, didFailToReceiveAdWithError error: NSError!) {
  
      //move off bounds when add didnt load
  
      adBannerView.center = CGPoint(x: adBannerView.center.x, y: view.bounds.size.height + view.bounds.size.height)
  
      println("Ad is not available")
  
  }
  </code></pre>