https://github.com/ml-opensource/fzcarousel
FZCarousel provides a straightforward, lightweight interface for producing an "infinitely" scrolling carousel in iOS apps.
https://github.com/ml-opensource/fzcarousel
Last synced: 4 months ago
JSON representation
FZCarousel provides a straightforward, lightweight interface for producing an "infinitely" scrolling carousel in iOS apps.
- Host: GitHub
- URL: https://github.com/ml-opensource/fzcarousel
- Owner: ml-opensource
- License: other
- Created: 2015-01-09T15:09:02.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2015-12-07T14:42:20.000Z (about 10 years ago)
- Last Synced: 2024-12-30T15:46:20.751Z (about 1 year ago)
- Language: Objective-C
- Size: 1.68 MB
- Stars: 21
- Watchers: 29
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

## Demo

#### Introduction
FZCarouselCollectionViewDelegate provides a straightforward, lightweight interface for producing an "infinitely" scrolling carousel.
## Usage
#### Implementing a subclass
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.
#### Standard Configuration
```obj-c
self.carouselCollectionViewDelegate = [FZDemoCarouselCollectionViewDelegate carouselCollectionViewDelegateForCollectionView:self.collectionView dataArray:self.dataArray defaultCrankInterval:2.0f lazyCrankInterval:2.5f];
```
#### Responding to cell selection
```obj-c
self.carouselCollectionViewDelegate.didSelectCellBlock =
^(UICollectionView *inCollectionView, NSIndexPath *inIndexPath, id inDataForIndexPath)
{
[tmpSelf showSelectionIndicator:YES withData:inDataForIndexPath];
};
```
#### Controlling the carousel
```obj-c
[self.carouselCollectionViewDelegate beginCarousel];
[self.carouselCollectionViewDelegate endCarousel];
```