dpstart dpstart - 12 days ago 8x
Swift Question

Slowing down UIScrollView scrolling

I'm using a UIScrollView to programatically animate some content.

However, I need to slow down the scrolling of the view.

This is the code I am using for the scrolling:

self.scrollView.setContentOffset(CGPoint(x: 0, y: self.view.frame.height), animated: true)

I have tried to add
scrollView.decelerationRate = UIScrollViewDecelerationRateFast
but it didn't seem to be working.


Try the following code:

UIView.animate(withDuration: 1.5) { 
    self.scrollView.contentOffset = CGPoint(x: 0, y: self.view.frame.height)