Call a swift function from java script that returns a value using wk webview
问题 I want to call a swift function from java script code which returns the device id back to the script, I had added the code that use currently. Please advise how to return the value back to the java script from the swift function, Thanks in advance Code Snippet : super.viewDidLoad() { self.webView = WKWebView() let preferences = WKPreferences() preferences.javaScriptEnabled = true let configuration = WKWebViewConfiguration() configuration.preferences = preferences configuration