Having trouble using JSContext to pass a variable to a javascript function. The error says stringToSend
is undefined:
func sendSomething(stringToSend : String) {
appController?.evaluateInJavaScriptContext({ (context) -> Void in
context.evaluateScript("myJSFunction(stringToSend)")
}, completion: { (evaluated) -> Void in
print("we have completed: \(evaluated)")
})
}