I have a UIWebView
where I'm rendering a PDF.
I need a method that hide the GUI if the pdf is not at the beginning of the page and show it again if the WebView
hit the top. How can I check this?
You can use scrollViewDelegate
method scrollViewDidScroll
for that like this way.
func scrollViewDidScroll(scrollView: UIScrollView) {
if (scrollView.contentOffset.y == 0) {
//Do what you want.
}
}
Note: Don't forgot to set scrollView
delegate of webView
like this self.webView.scrollView.delegate = self
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With