The way to repair the "Can’t instantiate the category named WKWebView" error when utilizing WebKit
A reader requested me a query concerning the following error when utilizing WKWebView within the storyboard:
Can’t instantiate the category named WKWebView as a result of no class named WKWebView has been discovered; the category have to be outlined within the supply or linked code from a library (be sure the category is a part of the fitting goal) "
He created a view controller with a WKWebView utilizing Interface Builder (or storyboard) and related it with code through an output variable like this:
@IBOutlet var webView: WKWebView!
@IBOutlet var WebView: WKWebView!
When accessing the online view, the applying has closed and displayed the error above.
To resolve this error, merely add the WebKit framework to your Xcode undertaking. In the event you have no idea learn how to manually add the body, observe these steps:
1. Within the undertaking browser, choose your undertaking.
2. Subsequent, choose the goal and select the Construct Section tab.
three. Beneath the Hyperlink Binary with Libraries part, click on the + button.
four. Enter WebKit, and add the WebKit framework.
That's all. Run your undertaking once more and you need to be capable of launch the online view with out error.
Founding father of AppCoda. Writer of a number of iOS programming books, together with iOS 12 Starting Programming with Swift and Intermediate iOS 12 Programming with Swift. Developer of iOS and Blogger purposes. Comply with me on Fb, Twitter and Google+.
What's new in Swift 2.zero: A short introduction
MapKit Newbie's Information: Polylines, Polygons and Legends