2

I Am using iCarousel framework. https://github.com/nicklockwood/iCarousel

There I want to find out the swipe direction of a view, because i am having next and previous actions, need to give for right and left scrolling.

Binarian
  • 12,296
  • 8
  • 53
  • 84
Smith
  • 379
  • 6
  • 18

1 Answers1

0

If I understand your question correctly, you want to know when the user scrolled the carousel and to know in which direction did she scroll. If so, you should implement the method

- (void)carouselCurrentItemIndexDidChange:(iCarousel *)carousel;

and compare the new index with the previous (stored) value - if the new one is greater than before, the user scrolled right, if it's smaller - scroll left.

Peter Sarnowski
  • 11,900
  • 5
  • 36
  • 33
  • @ Peter Sarnowski thanks for the reply, what happens if suppose im in 0th index (first card) and assume i have 10 cards and when user swipes back that time the 9th index 9>0 (newIndex>oldIndex) but user is scrolling left know?? – Smith Oct 03 '13 at 07:57
  • Well, you would have to add two exception cases -> when oldIndex == 0 and oldIndex == itemCount and treat them appropriately. In all other, simple comparison will suffice. – Peter Sarnowski Oct 03 '13 at 08:34