Skip to content

Instantly share code, notes, and snippets.

@colinhumber
Created February 2, 2012 21:34
Show Gist options
  • Save colinhumber/1725914 to your computer and use it in GitHub Desktop.
Save colinhumber/1725914 to your computer and use it in GitHub Desktop.
- (GMGridViewCell *)GMGridView:(GMGridView *)gridView cellForItemAtIndex:(NSInteger)index {
CGSize size = [self sizeForItemsInGMGridView:gridView];
GMGridViewCell *cell = [gridView dequeueReusableCell];
if (!cell) {
cell = [[GMGridViewCell alloc] initWithFrame:CGRectMake(0, 0, size.width, size.height)];
}
Piece *piece = [self.project.pieces objectAtIndex:index];
PieceView *pieceView = [[PieceView alloc] initWithFrame:CGRectMake(0, 0, size.width, size.height) piece:piece];
pieceView.captionVisible = self.showCaption;
cell.contentView = pieceView;
return cell;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment