I would try to set to the collection view on the same view controller, but at runtime it shows the error of signal SIGABRT error so please tell me what can I do to add to the collection view on the same view controller?
Asked
Active
Viewed 2,706 times
-3
-
Add exception breakpoint, then update code and the error info. – Balaji Ramakrishnan May 10 '16 at 11:21
-
get error of datasource & delegate – Siddharth Shah May 10 '16 at 11:25
-
2Show your error. So that we can understand your issue – Balaji Ramakrishnan May 10 '16 at 11:27
-
You have a bug on line 192. I can tell that because I am psychic and can read your code from my computer. (That's sarcasm.) We can't possibly help you unless you provide more information. – Duncan C May 10 '16 at 11:30
-
Also share the functionality you want to achieve , might be you are designing it in bad way. – Pandey_Laxman May 10 '16 at 11:30
-
I want to add one horizontal & one vertical collection view on one view controller. Now please tell me what can i do? – Siddharth Shah May 10 '16 at 11:34
-
what is the error? – Bhavin Ramani May 10 '16 at 12:03
-
You can try as http://stackoverflow.com/questions/28750108/multiple-collectionview-in-a-uiviewcontroller-ios-swift – DShah May 13 '16 at 06:28
1 Answers
2
You can add two collection view in a single view controller by dragging it.
but you have to validate UIcollection view like
func collectionView(collectionView: UICollectionView,
cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
var cell = HomeCollectionViewCell()
if(collectionView == self.collName1)
{
cell = collName.dequeueReusableCellWithReuseIdentifier("CellIdentifier", forIndexPath: indexPath) as! HomeCollectionViewCell
}
else
if(collectionView == self.collName2)
{}
return cell
}

Patrick Hofman
- 153,850
- 22
- 249
- 325

Vivek Gajbe
- 411
- 2
- 14