UIWebview
has (had?) an extremely useful function that enabled access to javascript
variables from Swift
.
func stringByEvaluatingJavaScriptFromString(_ script: String) -> String?
Does WKWebview
have an equivalent function or idiom enabling access to javascript
variables from Swift
?
Yes, WKWebView Also Have EvaluateJavaScript Method that enables you to run javascript code and access to javascript variables.
func evaluateJavaScript(_ javaScriptString: String,
completionHandler: ((Any?, Error?) -> Void)? = nil)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With