RFQuiltLayout 1.1.1

RFQuiltLayout 1.1.1

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

Maintained by Unclaimed.


Downloads

Total642,544
Week0
Month0

Installs

Apps1,073
Test Targets115
Watch Apps1
powered by Segment

GitHub

Stars866
Watchers42
Forks143
Issues19
Contributors7
Pull Requests3

Code

Files2
LOCLines of Code 274


  • By
  • bryce

RFQUILTLAYOUT

RFQuiltLayout is a UICollectionViewLayout subclass, used as the layout object of UICollectionView.

Demo 1 Demo 2

Installation

Add the layout as the subclass of your UICollectionViewLayout.

Subclass the layout

Make sure you set the delegate of the flow layout

- (void) viewDidLoad {
  // ...

  RFQuiltLayout* layout = (id)[self.collectionView collectionViewLayout];
  layout.direction = UICollectionViewScrollDirectionVertical;
  layout.blockPixels = CGSizeMake(100, 100);
}

- (CGSize) blockSizeForItemAtIndexPath:(NSIndexPath *)indexPath {
    if (indexPath.row % 2 == 0)
        return CGSizeMake(2, 1);

    return CGSizeMake(1, 2);
}

(Note: all delegate methods and properties are optional)