如何在同一视图控制器上使用两个CollectionView逐个滚动

我会尝试设置到相同的视图控制器上的集合视图,但在运行时它显示信号SIGABRT错误的错误,所以请告诉我可以做什么添加到相同的视图控制器上的集合视图?

您可以通过拖动添加两个集合视图到单个视图控制器中。

但你必须像validationUIcollection视图一样

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 }