Skip to content

Instantly share code, notes, and snippets.

@ydn
Created June 10, 2015 21:42
Show Gist options
  • Save ydn/30eb4542f65bd2f2e6f4 to your computer and use it in GitHub Desktop.
Save ydn/30eb4542f65bd2f2e6f4 to your computer and use it in GitHub Desktop.
Banner Ad example (full) with Swift
class ViewController: UIViewController, FlurryAdBannerDelegate {
// Initialize ad space to fetch ads from
let adBanner = FlurryAdBanner(space: "ADSPACE");
override func viewDidAppear(animated: Bool){
super.viewDidAppear(animated);
// Fetch and display banner ad for a given ad space
adBanner.adDelegate = self;
adBanner.fetchAnddisplayAdInView(self.view, viewControllerForPresentation: self);
}
override func viewDidDisappear(animated: Bool){
super.viewDidDisappear(animated);
// Do not set ad delegate to nil and do not remove ad in the ViewWillDisappear or ViewDidDisappear method
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment