Skip to content

Instantly share code, notes, and snippets.

@hafizrahman
Created October 5, 2013 00:54
Embed
What would you like to do?
How to use tag in datasource methods.
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
NSInteger collectionID = collectionView.tag;
// do something about the id......
}
// The cell that is returned must be retrieved from a call to -dequeueReusableCellWithReuseIdentifier:forIndexPath:
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
NSInteger collectionID = collectionView.tag;
// do something about the id...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment