Is it possible to use AdMob ads in WKWebView on iOS?

Output display : fatal error: unexpectedly found nil while unwrapping an Optional value and the thread is : Thread 1: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)

Thanks!

@IBOutlet weak var JCBannerView: GADBannerView! var JCwebView: WKWebView! override func loadView() { let webConfiguration = WKWebViewConfiguration() JCwebView = WKWebView(frame: .zero, configuration: webConfiguration) JCwebView.uiDelegate = self view = JCwebView }

override func viewDidLoad() {
    super.viewDidLoad()
    // Do any additional setup after loading the view, typically from a nib.
    print("Google Mobile Ads SDK version: (GADRequest.sdkVersion())")
    JCBannerView.adUnitID = "ca-app-pub-5648681agsga2/9390sgdsgasd596"
    JCBannerView.rootViewController = self
    JCBannerView.load(GADRequest())

    let myURL = URL(string: "https://google.com")
    let myRequest = URLRequest(url: myURL!)
    JCwebView.load(myRequest)
}
链接地址: http://www.djcxy.com/p/87750.html

上一篇: insertSubView:不显示我的意见

下一篇: iOS上的WKWebView中可以使用AdMob广告吗?