Невозможно преобразовать значение типа GameScene в ожидаемый тип аргумента UIViewController.IOS

Программируем под IOS
Гость
Невозможно преобразовать значение типа GameScene в ожидаемый тип аргумента UIViewController.

Сообщение Гость »


I am trying to show AdMob interstitial ads in gamescene Xcode. When I try to load them using the google tutorial it says


Error - Cannot convert value of type 'GameScene' to expected argument type 'UIViewController'.


Here is the code

Код: Выделить всё

if self.interstitial.isReady {
self.interstitial.present(fromRootViewController: self)
}
else{
print("failed to load")
}
I tried to do - as UIViewController - after the self but it still did not work.


Источник: https://stackoverflow.com/questions/517 ... viewcontro

Вернуться в «IOS»