I had a manually dragged scrollview, now I want a scrollview moved programmatically when I click a button, by this code:
offset = CGPointMake(scrollView.contentOffset.x+320, 0);
[UIScrollView beginAnimations:@"scrollAnimation" context:nil];
[UIScrollView setAnimationDuration:0.5];
[scrollView1 setContentOffset:offset];
[UIScrollView commitAnimations];
It works well but now the functions scrollViewBeginDragging and scrollViewEndDecelerating are not called. Begindragging is no problem for me, but I don’t know how detect the end of de scrollview movement when it is fired programmatically.
Thanks in advance!
Implement the
scrollViewDidEndScrollingAnimation:delegate method. That’s exactly what it’s for.