Swift Sprite Kit: How do I make it so that iAd displays a new add after a certain time interval?

| | August 18, 2015

I implemented iAd into my swift sprite kit application, but want to make it so that iAd displays a new ad every minute for example. I supplied my code for how I implemented iAd below.

 self.canDisplayBannerAds = true
    self.adBannerView?.delegate = self
    self.adBannerView?.hidden = true
}


func bannerViewWillLoadAd(banner: ADBannerView!) {

}

func bannerViewDidLoadAd(banner: ADBannerView!) {
    self.adBannerView?.hidden = false
}

func bannerViewActionDidFinish(banner: ADBannerView!) {

}

func bannerViewActionShouldBegin(banner: ADBannerView!, willLeaveApplication willLeave: Bool) -> Bool {

    return true
}

func bannerView(banner: ADBannerView!, didFailToReceiveWithError error:NSError!) {

}

One Response to “Swift Sprite Kit: How do I make it so that iAd displays a new add after a certain time interval?”

  1. You can use NSTimer for that. Keep in mind that if your app goes into background mode, it may cause some inaccuracies. However since it’s only for showing ads, it’s shouldn’t be a big issue.

Leave a Reply