Skip to content
This repository

View that display cells as a grid. Uses quite the same API as UITableView

tag: 0.2.0

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 GridViewExample
Octocat-spinner-32 .gitattributes
Octocat-spinner-32 .gitignore
Octocat-spinner-32 LICENSE
Octocat-spinner-32 OHGridView.h
Octocat-spinner-32 OHGridView.m
Octocat-spinner-32 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.