Reputation: 1098
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.
Upvotes: 1
Views: 1171
Reputation: 328
Try the following code:
UIView.animate(withDuration: 1.5) {
self.scrollView.contentOffset = CGPoint(x: 0, y: self.view.frame.height)
}
Upvotes: 1