I have a simple WKWebview.
At first, I am able to get its height once the webview is loaded.
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
webView.evaluateJavaScript("document.body.scrollHeight;") { (result, error) in
if error == nil, let value = result {
if let height = value as? Int {
// found the webview's height here.
}
}
}
}
But after this, I need to get the webview's height while typing. How to achieve this in iOS, swift?