Skip to content

Instantly share code, notes, and snippets.

@kylefox
Created February 2, 2012 21:30
Show Gist options
  • Save kylefox/1725892 to your computer and use it in GitHub Desktop.
Save kylefox/1725892 to your computer and use it in GitHub Desktop.
- (GMGridViewCell *)GMGridView:(GMGridView *)gridView cellForItemAtIndex:(NSInteger)index {
CGSize size = [self sizeForItemsInGMGridView:gridView];
// TODO: should be using dequeReusableCell, but that doesn't appear to be working here...
GMGridViewCell *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 addSubview:pieceView];
cell.contentView = pieceView;
return cell;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment