I had problems launching webapp in WKWebView (in particular: some buttons do not respond). I used this tutorial as a guide and succeeded in having a web view display my webapp. So now I want to debug javascript code.
I know that webapp works, since I tried it both in the Android browser and in countless browsers (including safari on the iPad simulator that I use). After some quick searching, I learned how to debug javascript inside a UIWebView using Safari . Unfortunately, this is not like the new WKWebView.
When I go to Develop->iPad Simulator , they tell me that there is "There are no verified applications." I tried the same thing with a simple application with UIWebView, and safari debugging works great there.
Is there a way to debug javascript code in WKWebView?
To reproduce my problems (using fast), start a new single-screen project in xCode 6, copy the code (kindly provided by kinderas ) below in your ViewController.swift file, and drag the outlet into the View under the View Controller in the document outline in the Main.storyboard file Main.storyboard . Refer to the manual that I linked above in case of confusion.
import UIKit import WebKit class ViewController: UIViewController { @IBOutlet var containerView : UIView! = nil var webView: WKWebView? override func loadView() { super.loadView() self.webView = WKWebView() self.view = self.webView! } override func viewDidLoad() { super.viewDidLoad() var url = NSURL(string:"http://www.kinderas.com/") var req = NSURLRequest(URL:url) self.webView!.loadRequest(req) } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() } }
javascript debugging ios ios8 wkwebview
overactor
source share