Skip to content Skip to sidebar Skip to footer

Return Javascript Value In Swift

I need to return a value in Swift by executing JavaScript, but I am having trouble I have searched everywhere, but I can't find anything that works. To execute the JavaScript, I am

Solution 1:

To access the value you have to provide a completion handler to evaluateJavaScript, see the docs:

webby.evaluateJavaScript("<your code goes here>") { result, error in
  if let result = result {
    // your result handling goes here
  }
}

Post a Comment for "Return Javascript Value In Swift"