قالب وردپرس درنا توس
Home / IOS Development / Could not instantiate the WKWebView class

Could not instantiate the WKWebView class



I received a question from a reader about the following errors using WKWebView in storyboard:

Could not instantiate the WKWebView class because no class named WKWebView was found; the class must be defined in the source code or linked from a library (make sure the class is part of the correct target)

He created a viewing controller with a WKWebView using Interface Builder ( or storyboard) and connected it with code via an output variable like this:

When you open the web view, the app will close and display the error above.

To fix the error, you just need to add the WebKit framework to your Xcode project. If you do not know how to manually add the frame, follow these procedures:

1. In the project navigator, select your project.

2. Then select the target and select the Construction Phase tab.

  Xcode Project Using WKWebView

3. Under the Binary with libraries section, click the + button.

4. Enter WebKit, then add the WebKit framework.

  Adding the WebKit Frame

That's it. Run the project again and you should be able to start the web view without the error.

Swift

What's New in Swift 2.0: A Brief Introduction


iOS

MapKit Beginner's Guide: Polylines, Polygons and Callouts


iOS

Adding Animated effects to the IOS App using UIKit Dynamics



Source link