像這樣呼叫函數:
func setCompleteAdInJavaScript() { let javascriptFunction = """ gameState.setCredits('200'); """ webView.evaluateJavaScript(javascriptFunction) { result, error in if let _ = error { print("设置积分出错") } else { print("成功设置积分。") } } }
像這樣呼叫函數: