Last active
August 29, 2015 14:22
-
-
Save ydn/7d9736d6c838ee5faa3f to your computer and use it in GitHub Desktop.
Flurry Full-Screen Ads with Swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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