我想在用户丢失时在我的应用中加载一个admob插页式广告,但我不能因为我使用的是spritekit(swift),这是我的代码:
self.interstitial.presentFromRootViewController(interstitial)
这是我的错误:
cannot convert value of type 'GameScene' to expected argument type 'UIViewController!'
希望你们中的一个人有答案! thx
答案 0 :(得分:0)
您试图自己展示interstitial
。
您应该从当前可见的ViewController中显示它:
self.interstitial.presentFromRootViewController(self)
(假设self
是一个视图控制器)。
<强>更新强>
如果您密切关注Google tutorial ,您会看到我正在谈论的内容:
func gameOver() {
if self.interstitial.isReady {
self.interstitial.presentFromRootViewController(self)
}
// Rest of game over logic goes here.
}