FZCarouselCollectionViewDelegate provides a straightforward, lightweight interface for producing an "infinitely" scrolling carousel.
Users of this class should begin by subclassing it. Subclasses should handle all UICollectionViewDataSource, UICollectionViewDelegateFlowLayout, and UICollectionViewDelegate methods that need to be overwritten to produce the desired collectionView layout. At minimum, it is expected that users will overwrite -collectionView:cellForItemAtIndexPath:, and an exception will be thrown if this is not the case.
This class, in turn, will handle all "carousel concerns," which include manipulation and syncing of the data array, page control updates, and, of course, carousel cranking.
self.carouselCollectionViewDelegate = [FZDemoCarouselCollectionViewDelegate carouselCollectionViewDelegateForCollectionView:self.collectionView dataArray:self.dataArray defaultCrankInterval:2.0f lazyCrankInterval:2.5f];
self.carouselCollectionViewDelegate.didSelectCellBlock =
^(UICollectionView *inCollectionView, NSIndexPath *inIndexPath, id inDataForIndexPath)
{
[tmpSelf showSelectionIndicator:YES withData:inDataForIndexPath];
};
[self.carouselCollectionViewDelegate beginCarousel];
[self.carouselCollectionViewDelegate endCarousel];