pbd

PBDCarouselCollectionViewLayout

Showing:

Popularity

Downloads/wk

0

GitHub Stars

65

Maintenance

Last Commit

4yrs ago

Contributors

1

Package

Dependencies

0

License

MIT

Categories

Readme

Carousel Collection View layout

Simple and completely contained UICollectionViewLayout subclass that enables paging within collection view. Benefits above just turning on pagingEnabled is that your items can have sizes smaller than whole width of your collection (aka it snaps scroll position to center each item, see below).

Layout is automatically adjusted after rotation (or any bounds change) and currently centered item stays centered.

This is also an example of a completely custom UICollectionViewLayout subclass.

Demo

Usage

@interface CarouselCollectionViewLayout : UICollectionViewLayout

@property(nonatomic) CGSize itemSize;

@property(nonatomic) CGFloat interItemSpace;

@property(nonatomic) CGSize headerSize;

@property(nonatomic) CGSize footerSize;

@end

Just instantiate PBDCarouselCollectionViewLayout instance and set its itemSize (which defines size of each item) and interItemSpace (which defines spacing between items).

You can also optionally set headerSize or footerSize to a non-CGSizeZero value to enable header and/or footer. Please use UICollectionElementKindSectionHeader/UICollectionElementKindSectionFooter identifiers to register supplementary view classes / nibs.

Right now you can only select horizontal scrolling.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100