像这样调用函数:
func setCompleteAdInJavaScript() { let javascriptFunction = """ gameState.setCredits('200'); """ webView.evaluateJavaScript(javascriptFunction) { result, error in if let _ = error { print("设置积分出错") } else { print("成功设置积分。") } } }
像这样调用函数: