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

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

gradle error "Cannot convert the provided notation to a File or URI" -

python - NameError: name 'subprocess' is not defined -