userContentController(_:didReceive:)
Tells the handler that a webpage sent a script message.
Declaration
func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage)Parameters
- userContentController:
The user content controller that delivered the message to your handler.
- message:
An object that contains the message details.
Discussion
Use this method to respond to a message sent from the webpage’s JavaScript code. Use the message parameter to get the message contents and to determine the originating web view.