Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
View that display cells as a grid. Uses quite the same API as UITableView
Objective-C
tag: 0.3.0

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
GridViewExample
.gitattributes
.gitignore
LICENSE
OHGridView.h
OHGridView.m
README

README

This class allows you to display a grid of views.
Its API is very similar to the API of UITableView : it can reuses/recycle cells to avoid too much allocations and it uses tiling to avoid having a too big memory footprint.

You can configure its properties like rowHeight, columnCount, É

Then, to use it, you simply have to implement the methods of the OHGridViewDataSource protocol, like you would do for a UITableView:
-(NSUInteger)numberOfItemsInGridView:(OHGridView *)aGridView;
-(OHGridViewCell*)gridView:(OHGridView *)aGridView cellAtIndexPath:(NSIndexPath *)indexPath;

You can also implement the GridViewDelegate protocol especially to handle when a cell is tapped:
-(void)gridView:(OHGridView *)aGridView didSelectCellAtIndexPath:(NSIndexPath *)indexPath;


See the "GridViewExample" project for a basic usage example (including changing the number of columns used when the iPhone orientation changes)
Something went wrong with that request. Please try again.