CocoaPods trunk is moving to be read-only. Read more on the blog, there are 14 months to go.
| TestsTested | ✗ |
| LangLanguage | Obj-CObjective C |
| License | MIT |
| ReleasedLast Release | Dec 2014 |
Maintained by Peter Meyers.
PMCircularCollectionView is a subclass of UICollectionView that scrolls infinitely in the horizontal or vertical direction. PMCircularCollectionView also includes a subclass which automatically centers the cell nearest to the middle of the collection view after scrolling.
platform :ios, '7.0'
pod "PMCircularCollectionView"PMCenteredCollectionViewFlowLayout *layout = [UICollectionViewFlowLayout new];
layout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
layout.minimumLineSpacing = 10;
layout.minimumInteritemSpacing = 0;
PMCenteredCircularCollectionView *collectionView = [PMCircularCollectionView collectionViewWithFrame:self.view.bounds collectionViewLayout:layout];
collectionView.delegate = self;
collectionView.dataSource = self;- (UICollectionViewCell *) collectionView:(PMCenteredCircularCollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:PMCellReuseIdentifier forIndexPath:indexPath];
NSInteger normalizedIndex = [collectionView normalizeIndex:indexPath.item];
/*
* Configure cell based on indexPath.section and normalizedIndex.
*/
}PMCenteredCollectionViewFlowLayout *layout = [PMCenteredCollectionViewFlowLayout new];
layout.centeringDisabled = NO;
layout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
layout.minimumLineSpacing = 10;
layout.minimumInteritemSpacing = 0;
PMCenteredCircularCollectionView *collectionView = [PMCenteredCircularCollectionView collectionViewWithFrame:self.view.bounds collectionViewLayout:layout];
collectionView.delegate = self;
collectionView.dataSource = self;- (void) collectionView:(PMCenteredCircularCollectionView *)collectionView didCenterItemAtIndex:(NSUInteger)index
{
NSUInteger normalizedIndex = [collectionView normalizeIndex:index];
NSLog(@"Collection View: %@\nDid center item at index %d", collectionView, normalizedIndex);
}PMCircularCollectionView is available under the MIT license. See the LICENSE file for more info.