samedi 9 mai 2015

how to add functions to segue swift

How can I run this ad while segue is running? Segue(modal) is working. I wrote it programatically. But when I tried to run the ad I couldn't. How can I run it?

    var interstitial: GADInterstitial!
    func createAndLoadInterstitial() -> GADInterstitial {
        var interstitial = GADInterstitial(adUnitID: "ca-app-pub-5378899862041789/2782958552")
        interstitial.delegate = self
        interstitial.loadRequest(GADRequest())

        return interstitial
    }

    func getAd(){
        if (self.interstitial.isReady)
        {


 self.interstitial.presentFromRootViewController(self)
        self.interstitial = self.createAndLoadInterstitial()
    }
}


@IBAction func webView(sender: UIButton) {
    getAd()
    performSegueWithIdentifier("mapView", sender: nil)
}

Aucun commentaire:

Enregistrer un commentaire