0

scrollViewWillBeginDecelerating: delegate method is called on finger up as it is moving.(from UIScrollView.h)
But, scrollViewDidEndDragging:willDecelerate: delegate method is also called when same state.
(called on finger up if the user dragged. decelerate is true if it will continue moving afterwards) -> from UIScrollView.h)

When I test, they are always called together.
I don't know what is the difference.

Actually, I should know when a scroll will be begun deceleration.
scrollViewWillBeginDecelerating: is always called on finger up.

Bala
  • 1,224
  • 1
  • 13
  • 25
strawnut
  • 359
  • 5
  • 21

2 Answers2

0

No both has differrent states

scrollViewDidEndDragging - The scroll view sends this message when the user’s finger touches up after dragging content. The decelerating property of UIScrollView controls deceleration.

scrollViewWillBeginDecelerating - The scroll view calls this method as the user’s finger touches up as it is moving during a scrolling operation; the scroll view will continue to move a short distance afterwards. The decelerating property of UIScrollView controls deceleration. Refer Here

Bala
  • 1,224
  • 1
  • 13
  • 25
0

If you drag the scroll view so slowly that after your finger is up, the scroll view won't move, then scrollViewDidEndDragging:willDecelerate: will be called, with decelerate == NO, while the scrollViewWillBeginDecelerating: not being called.

Both the delegate methods will be called when you drag fast enough.

eternity
  • 473
  • 5
  • 8
  • Yes, I know the difference in case of the parameter decelerate == NO. But if I drag fast enough, I can't understand why the two methods exist. – strawnut Jun 12 '16 at 06:46