Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to add WKWebView to Xcode Project

I have a ViewController that looks something like:

import UIKit
import WebKit

class ViewController: UIViewController {
    @IBOutlet var webView: WKWebView!
}

In my storyboard I have a WKWebView as a subview of my main view. I've linked up the IBOutlet but when I run the application I receive:

EXC_BAD_ACCESS (code=1, address=0x431)

enter image description here enter image description here

What am I doing wrong here and how do I fix it?

like image 633
Kyle Decot Avatar asked Mar 14 '23 16:03

Kyle Decot


1 Answers

WKWebView is not supported on Storyboards. You have to create it by code. The web view element you are using in your Storyboard is a UIWebView.

like image 159
Ruben Marin Avatar answered Mar 28 '23 01:03

Ruben Marin