2017-03-06 6 views
0

私のアプリでは、インタースティシャル広告をいくつかのセグに統合しています。ユーザーが広告を終了するまでSegueを防止しますか?

問題は間隙の負荷であり、その後、セグのトリガによって即座に無効になります。

広告が閉じられるまで、セグを実行しないように機能を一時停止する方法はありますか?それを解決するために私が考えることができる唯一の方法です。コードは以下の通りです:

@IBAction func closeExerciseDetails(_ sender: Any) { 
    if (self.interstitial.isReady) { 
     self.interstitial.present(fromRootViewController: self) 
     self.interstitial = self.createAd() 
    } 
    self.performSegue(withIdentifier: "unwindToExercisesSegue", sender: self) 
} 

EDIT:あなたはちょうどこのデリゲートでセグエを行うことができます

- (void)interstitialDidDismissScreen:(GADInterstitial *)interstitial { 
} 

:作業イマイチ新しいコード...

@IBAction func closeExerciseDetails(_ sender: Any) { 
    if (self.interstitial.isReady) { 
     self.interstitial.present(fromRootViewController: self) 
     self.interstitial = self.createAd() 
    } 
} 

func interstitialDidDismissScreen(_ ad: GADInterstitial) { 
    self.performSegue(withIdentifier: "unwindToExercisesSegue", sender: self) 
} 

答えて

3

このためデリゲートがあります。

+0

これは迅速なものですか?私はそれを見つけることができない? – jwarris91

+0

func interstitialDidDismissScreen(_ ad:GADInterstitial){ } –

+0

編集:いいえ、私はサブクラスを設定していません – jwarris91

関連する問題