We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import UIKit import WebKit class ViewController: UIViewController, WKNavigationDelegate { var mainWebView : WKWebView = WKWebView.init(); override func viewDidLoad() { super.viewDidLoad() mainWebView.frame = view.frame; self.view.addSubview(mainWebView) } override func viewWillAppear(_ animated: Bool) { var bridge = WKWebViewJavascriptBridge.init(for: mainWebView); let url = URL(string: "http://127.0.0.1:8283")! mainWebView.load(URLRequest(url: url)) } }
When I comment out WKWebViewJavascriptBridge.init(for: mainWebView); the web page loads fine, otherwise it is a blank white screen. Any ideas why?
WKWebViewJavascriptBridge.init(for: mainWebView);
The text was updated successfully, but these errors were encountered:
Closing.. here's what worked.
import UIKit import WebKit class ViewController: UIViewController, WKNavigationDelegate { var mainWebView : WKWebView = WKWebView.init(); var bridge : WKWebViewJavascriptBridge!; override func viewWillAppear(_ animated: Bool) { mainWebView.frame = self.view.frame; mainWebView.navigationDelegate = self; bridge = WKWebViewJavascriptBridge( for: mainWebView)!; bridge!.setWebViewDelegate(self); let url = URL(string: "http://127.0.0.1:8283")! mainWebView.load(URLRequest(url: url)) } func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) { bridge!.setWebViewDelegate(self); self.view.addSubview(mainWebView) } }
Sorry, something went wrong.
No branches or pull requests
When I comment out
WKWebViewJavascriptBridge.init(for: mainWebView);
the web page loads fine, otherwise it is a blank white screen. Any ideas why?The text was updated successfully, but these errors were encountered: