Skip to content

Instantly share code, notes, and snippets.

@hafizrahman
Last active December 24, 2015 17:19
Show Gist options
  • Save hafizrahman/6835037 to your computer and use it in GitHub Desktop.
Save hafizrahman/6835037 to your computer and use it in GitHub Desktop.
Use setTag to as identifier for the UICollectionView objects, which can then be used by delegate and datasource methods.
for (int i = 0; i < 5; i++) {
UICollectionView *currentCollectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 0, maxWidth, collectionViewHeight) collectionViewLayout:layout];
// Trick to let the delegate and data source functions deal with the multiple UICollectionView's
[currentCollectionView setTag:i];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment