Search code examples
iosswiftuiadmob-rewardedvideoad

Protocol 'View' requirement '_makeView(view:inputs:). swiftui


what should I change? I am trying to make rewarded ad in swiftui

enter image description here


Solution

  • RewardedAdView should be a struct, not a class. If you need an NSObject subclass to use as a delegate or for the target/action pattern, make it the Coordinator type of RewardedAdView.

    Watch Integrating SwiftUI from WWDC 2019 for an explanation of how to implement a Coordinator class.