I have a ViewController that contains an UIScrollView and I'm trying to disable the bounce effect only on the top of the view.
I tried to add this answer in my ViewController class, which is saying to do this :
func scrollViewDidScroll(_ scrollView: UIScrollView) {
//disable bounce only at the top of the screen
scrollView.bounces = scrollView.contentOffset.y > 100
}
But I don't really understand what to do with this. I also tried to implement the UIScrollViewDelegate.
Nothing I tried worked.
Here is my StoryBoard and ViewController
What do I need to do in order to make it works ?
My setup :
Connect scrollView outlet and then try adding scrollView.delegate = self
or add scrollView.bounces = scrollView.contentOffset.y > 100
in your viewDidLoad()
function.