0

How can i change scrollview speed of "setContentOffset"?

scrollView.setContentOffset(CGPoint(x: 120.5, y: 0), animated: true)
Vadim Kotov
  • 7,766
  • 8
  • 46
  • 61
PERIPERI
  • 63
  • 7

1 Answers1

0

Wrap setContentOffset(offset, animated: false) inside an animation block

UIView.animate(withDuration: 0.5, animations: {
            scrollView.setContentOffset(CGPoint(x: 0, y: yOffset), animated: false)
        })
amish
  • 325
  • 3
  • 17