Skip to content

Instantly share code, notes, and snippets.

@ydn
Last active August 29, 2015 14:22
Show Gist options
  • Save ydn/7d9736d6c838ee5faa3f to your computer and use it in GitHub Desktop.
Save ydn/7d9736d6c838ee5faa3f to your computer and use it in GitHub Desktop.
Flurry Full-Screen Ads with Swift
// ViewController.swift
class ViewController: UIViewController, FlurryAdInterstitialDelegate {
let adInterstitial = FlurryAdInterstitial(space: "ADSPACE");
override func viewDidAppear(animated: Bool) {
super.viewDidAppear(animated);
adInterstitial.adDelegate = self;
adInterstitial.fetchAd();
}
// Display takeover ad on button press
@IBAction func showFullScreenAdClickedButton(sender: AnyObject){
if adInterstitial != nil && adInterstitial.ready {
println("Ready to display ad");
adInterstitial.presentWithViewController(self);
} else {
adInterstitial.fetchAd();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment