0

I am trying to show unity ads in my ios project. I am using SwiftUI (Not AppDelegate, not Storyboard). There are not much examples on the web, and the little of them there are old and does not support showing ads with swiftui. Even the unity documentation website does not support it yet. please help me, I get this error from my show ads method and the code won't build: Cannot convert value of type 'UIViewController.Type' to expected argument type 'UIViewController'

import SwiftUI
import UnityAds

//Initialize Unity ads here
UnityAds.initialize("307659", testMode: true)

func loadInterstitial_UnityAds(){
    if UnityAds.isInitialized(){
        UnityAds.load("video")
    }
}
func showAds_Unity(){
    UnityAds.show(UIViewController, placementId:"307659", showDelegate: nil)
}
ThePyzhov
  • 259
  • 2
  • 14

0 Answers0