scrollViewWillEndDragging(_:withVelocity:targetContentOffset:)
Tells the delegate when the user finishes scrolling the content.
Declaration
optional func scrollViewWillEndDragging(_ scrollView: UIScrollView, withVelocity velocity: CGPoint, targetContentOffset: UnsafeMutablePointer<CGPoint>)Parameters
- scrollView:
The scroll-view object where the user ended the touch.
- velocity:
The velocity of the scroll view (in points per millisecond) at the moment the touch was released.
- targetContentOffset:
The expected offset when the scrolling action decelerates to a stop.
Discussion
Your application can change the value of the targetContentOffset parameter to adjust where the scrollview finishes its scrolling animation.