ios - How to set a tag to UICollectionView - SWIFT - Multiple CollectionViews on same screen -
i have multiple uicollectionview on same screen. know objective-c can set tag of each collectionview code below. can't figure out how same on swift
[self.collectionviewone settag:1]; [self.collectionviewtwo settag:2]; [self.collectionviewthree settag:3]; //then inside "cellforitematindexpath" if tag equal then... if(collectionview.tag==1) { //... }
self.collectionviewone.tag = 1 if(collectionview.tag == 1) { //... }
is mean? it's same thing.
that said, why not compare actual objects instead of using tags?
if(collectionview == self.collectionviewone) { //... }
Comments
Post a Comment