CocoaPods trunk is moving to be read-only. Read more on the blog, there are 14 months to go.

EPSCollectionViewFormLayout 1.1

EPSCollectionViewFormLayout 1.1

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Dec 2014

Maintained by Peter Stuart.



  • By
  • Peter Stuart and Justin Stuart

EPSCollectionViewFormLayout is a subclass of UICollectionViewLayout that makes it easy to layout forms, like login and address forms, in a collection view.

Address Example Login Example

For an example of how to use EPSCollectionViewFormLayout, see the example project.

When using EPSCollectionViewFormLayout, each section in the collection view is laid out in one row. Your collection view’s delegate must implement the two methods in the EPSCollectionViewFormLayoutDelegate protocol:

- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout heightForSectionAtIndex:(NSInteger)section;

- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout relativeWidthOfItemAtIndexPath:(NSIndexPath *)indexPath;

The widths returned in collectionView:layout:relativeWidthOfItemAtIndexPath: are relative to the width of the collection view, so returning 0.5 would make the cell at that indexPath be half the width of the collection view.