Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A UICollectionViewLayout subclass to put items in a quilting pattern
Objective-C Ruby
tag: 1.0.3

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
DerivedData/QuiltDemo
QuiltDemo.xcodeproj
QuiltDemo
RFQuiltLayout
.gitignore
LICENSE.md
README.md
RFQuiltLayout.podspec

README.md

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)

Something went wrong with that request. Please try again.