WKWebView not in Xcode

XcodeWkwebview

Xcode Problem Overview


I need to implement the WKWebview for my ios app with Xcode. However i have error when using it "undeclared type 'WKWebview'". Do i missing anything important.

I'm using the latest Xcode7 download from App Store.

Xcode Solutions


Solution 1 - Xcode

If you are using swift, first import the WebKit module in any files you're using web kit API:

import WebKit

Then you can use the web view:

let webView = WKWebView()

Solution 2 - Xcode

you need to import webkit in file

import WebKit

Solution 3 - Xcode

You should import the header #import <WebKit/WebKit.h>

and add WebKit.framework in Build Phases if you're using objective-c.

Solution 4 - Xcode

Swift 5:

import WebKit

And add WebKit.framework in Frameworks section under General project settings

Solution 5 - Xcode

still dealing with Objective-C? 

#import <WebKit/WebKit.h>

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionkaneyipView Question on Stackoverflow
Solution 1 - XcodeJohnykuttyView Answer on Stackoverflow
Solution 2 - Xcodesaigopi.meView Answer on Stackoverflow
Solution 3 - XcodeKudoCCView Answer on Stackoverflow
Solution 4 - XcodeJay MehtaView Answer on Stackoverflow
Solution 5 - XcodeSergioView Answer on Stackoverflow