Search code examples
xcodeicarousel

iCarousel show one view per touch (slide)


I use iCarousel for slideshow views by do slide. Everything ok, but when i slide on the screen I show a few views at once but I need to show one view per slide.

I'm trying to change any data in - (void)didPan:(UIPanGestureRecognizer *)panGesture but still no progress. Should I change code her:

NSInteger direction = (int) (_startVelocity / fabsf(_startVelocity)); [self scrollToItemAtIndex:self.currentItemIndex + direction animated:YES];?

Has anybody has any ideas where else I can change code for my purpose?


Solution

  • iCarousel can't do this currently, but from your description it sounds like you should be using my SwipeView library instead, which was designed to work this way (I also wrote iCarousel by the way so this isn't some attempt to discredit it).

    SwipeView has exactly the same interface as iCarousel so it should be a drop-in replacement. It is based on UIScrollView however, and supports paging.

    https://github.com/nicklockwood/SwipeView

    UPDATE:

    The latest version of iCarousel does now support single-item swiping using the pagingEnabled property, but for simple 2D scrolling views, SwipeView is still the better choice.