1

How can i change scrollview speed of "setContentOffset"?

scrollView.setContentOffset(CGPoint(x: 120.5, y: 0), animated: true)
Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
PERIPERI
  • 73
  • 9

1 Answers1

1

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
  • 335
  • 4
  • 17