I've tried implementing other code on stackoverflow with no luck. I'm evaluating javascript in a WKWeview, and would like to listen for when the content has fully loaded in order to execute statements on the loaded page.
Javascript: (isn't executing func webView)
webView.evaluateJavaScript("_formHist.submit();", completionHandler: nil)
Code I've tried using so far: (only works on some pages)
func webView(_ webView: WKWebView,
didFinish navigation: WKNavigation!) {
//insert code
}
I'm new to iOS development, so please explain answers in depth if you can!