Tag: 塞格

Swift / XCode – 在dismissViewController期间AdMob插页式广告

我有一个简单的应用程序,需要一些帮助,让interstitials正确发射。 该应用程序只是两个意见。 MainVC和ModalVC。 在ModalVC上,有一个[CLOSE]button将用户返回到MainVC: @IBAction func closeButtonPressed(sender: UIButton) { self.dismissViewControllerAnimated(true, completion: nil). } 要从MainVC到ModalVC,我正在使用以下内容: self.performSegueWithIdentifier("mainSegue", sender: self) // Present Modally segue, default presentation, cross dissolve transition. 我遇到的主要问题是触发closeButtonPressed上的插页式广告。 我希望插页式广告在后台播放,而dismissViewController会执行。 这样,一旦用户完成了插页式广告,他们将返回到MainVC。 (插页式广告会每4次转换一次,只是一个参考,对于我的主要问题来说不是非常重要。)发生的是间隙性负载,然后立即closures。 见下面的代码: @IBAction func closeButtonPressed(sender: UIButton) { //INTERSTITIAL TRIGGER! if (self.interstitial.isReady) { self.interstitial.presentFromRootViewController(self) self.interstitial = self.createAd() dismissViewControllerAnimated(true, completion: nil) } else { dismissViewControllerAnimated(true, completion: nil) } […]