14

The documentation states it's points (per second, I'm assuming)? However, the values I get for it are in the (.5, 3.5) range. The scroll view then travels several hundred points before coming to a halt. The actual initial velocity should be different by orders of magnitude.

RS1
  • 143
  • 1
  • 6
  • I thought those could be screen or view heights (widths) but that wasn't it either. – RS1 Mar 14 '12 at 17:51
  • Perhaps it's in points per screen-refresh-interval, which is 1/60th of a second. Touch events are reported at the screen refresh interval, so this would make sense. – rob mayoff Mar 14 '12 at 17:55
  • I guess it could be, thanks. Problem is, there's still no way to get any meaningful data (e.g. time until it stops) out of the method - because we don't know the deceleration curve. – RS1 Mar 14 '12 at 18:17
  • Definitely [file a bug](http://bugreport.apple.com) requesting a documentation improvement here. Have you tried per-millisecond? – jtbandes Mar 16 '12 at 20:15
  • What are you attempting to do? Perhaps there is another way of looking at it? – Léo Natan Apr 19 '12 at 20:43

2 Answers2

17

It is points/millisecond. From UIScrollView.h:

// called on finger up if the user dragged. velocity is in points/millisecond. targetContentOffset may be changed to adjust where the scroll view comes to rest
- (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset NS_AVAILABLE_IOS(5_0);

This is from iOS 7 SDK, which seemed more plausible given the very low values they've been returning in velocity.

junjie
  • 7,946
  • 2
  • 26
  • 26
1

From Docs

called on finger up if the user dragged. velocity is in points/millisecond. targetContentOffset may be changed to adjust where the scroll view comes to rest

Matthew Quiros
  • 13,385
  • 12
  • 87
  • 132
daihovey
  • 3,485
  • 13
  • 66
  • 110