I need a bounce to refresh the page in webview
. But I don't need the bounce from the bottom. How do I make it bounce only from the top?
Currently, the values are divided into simple Bool values.
WKWebView.scrollView.bounces = false
extension WKWebViewController: UIScrollViewDelegate{
func scrollViewDidScroll(_ scrollView: UIScrollView) {
scrollView.bounces = (scrollView.contentOffset.y <= 0)
}
}
It is not work for me..
It's realy simple.
First, you have to designate delegate like this.
WKWebView.scrollView.delegate = self
and follow below code.
extension WKWebViewController: UIScrollViewDelegate{
func scrollViewDidScroll(_ scrollView: UIScrollView) {
scrollView.bounces = (scrollView.contentOffset.y <= 0)
}
}