I have a collectionView and in each cell I have a WKWebView loading html from a local file. I want to scroll down to a specific offset from code.
I have tried using:
self.webView.scrollView.contentOffset.y = offSet
and
self.webView.scrollView.setContentOffset(CGPoint(x: 0, y: offSet), animated: false)
with and without
layoutIfNeeded()
but with no success.
The func scrollViewDidScroll(_ scrollView: UIScrollView) {}
Does get called and the contentOffset.y does increase, but the scroll view does not move at all.