I can successfully obtain a variable from javascript and display it as an alert message in an iOS app as follows:
let loggedIn = self.webView.stringByEvaluatingJavaScript(from: "loggedIn");
let alertController = UIAlertController(title: "iOScreator", message:
loggedIn, preferredStyle: UIAlertControllerStyle.alert)
alertController.addAction(UIAlertAction(title: "Dismiss", style: UIAlertActionStyle.default,handler: nil))
self.present(alertController, animated: true, completion: nil)
The above works perfectly. Is there a similar option to pass a variable from iOS to a javascript variable and run a function that does a pop alert with that variable?
Any help, as always, is appreciated. Many thanks, Alan.