Skip to content
UICollectionViewLayout subclass for displaying items of different sizes in a grid without wasting any visual space. Inspired by: http://www.crispymtn.com/stories/the-algorithm-for-a-perfectly-balanced-photo-gallery
Objective-C Ruby
Branch: master
Clone or download
Latest commit 3e28b0d Dec 28, 2015
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
NHBalancedFlowLayout Fixed coding style Feb 16, 2014
NHBalancedFlowLayoutDemo Removed Unused itemSizes property Jan 24, 2014
.gitignore Added .gitignore Oct 18, 2013
LICENSE Added license Nov 7, 2013
NHBalancedFlowLayout.podspec Updated podspec version to 0.2 Jan 24, 2014
README.md Update README.md Dec 28, 2015

README.md

NHBalancedFlowLayout

UICollectionViewLayout subclass for displaying items of different sizes in a grid without wasting any visual space. Inspired by: http://www.crispymtn.com/stories/the-algorithm-for-a-perfectly-balanced-photo-gallery

This project is no longer maintained. For a more up-to-date version, check out: https://github.com/graetzer/NHBalancedFlowLayout

Notes

  • Tested with iOS 7, but should be compatible with iOS6 as well
  • Works with iPhone and iPad
  • All interface orientations are supported

Screenshots

Installation

The easiest way is to use CocoaPods. If you don't already, here's a guide.

pod 'NHBalancedFlowLayout', '~> 0.2'

If you don't use CocoaPods, you'll need to copy the following files into your project:

  • NHBalancedFlowLayout.h
  • NHBalancedFlowLayout.m
  • NHLinearPartition.h
  • NHLinearPartition.m

Credits

Attributions for the photos in the same order as they appear in the demo:

You can’t perform that action at this time.