Skip to content

Instantly share code, notes, and snippets.

@rd13
Created January 4, 2013 18:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rd13/4454684 to your computer and use it in GitHub Desktop.
Save rd13/4454684 to your computer and use it in GitHub Desktop.
Objective-C UICollectionViewCell Iteration
//cv = UICollectionView
for (int section = 0; section < [cv numberOfSections]; section++) {
for (int row = 0; row < [cv numberOfItemsInSection:section]; row++) {
NSIndexPath* cellPath = [NSIndexPath indexPathForRow:row inSection:section];
//Cast to a custom cell: "GameCollectionViewCell"
GameCollectionViewCell *cell = (GameCollectionViewCell *) [cv cellForItemAtIndexPath:cellPath];
NSLog(@"%i",cell.lbl.tag);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment