how to use two CollectionView on same view controller scroll one by one [closed]

倖福魔咒の 提交于 2019-12-06 16:28:07

问题


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?


回答1:


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
}   


来源:https://stackoverflow.com/questions/37136994/how-to-use-two-collectionview-on-same-view-controller-scroll-one-by-one

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!