Swift3 如何在UICollectionVIew中执行到不同控制器的切换
我想根据UICollectionView中的选择切换到不同的控制器:Swift3 如何在UICollectionVIew中执行到不同控制器的切换,swift3,Swift3,我想根据UICollectionView中的选择切换到不同的控制器: 重写func collectionView(collectionView:UICollectionView,didSelectItemAt indexPath:indexPath){ 根据集合视图中的选择,它应与不同的UiCollectionView控制器相分离 Tried this command self.performsgue(标识符为“Selection1”,发件人为self) 但它错了: “NSInternalIn
重写func collectionView(collectionView:UICollectionView,didSelectItemAt indexPath:indexPath){ 根据集合视图中的选择,它应与不同的UiCollectionView控制器相分离
Tried this command
self.performsgue(标识符为“Selection1”,发件人为self)
但它错了:
“NSInternalInconsistencyException”,原因:“无法将具有标识符ProductCell的UICollectionElementKindCell类型的视图出列-必须为标识符注册nib或类,或连接情节提要中的原型单元格”
表演这种音乐的最佳方式是什么?
请告知
谢谢重写func collectionView(collectionView:UICollectionView,didSelectItemAt indexPath:indexPath){
此外,为了消除错误,我必须更新集合可重用视图中的标识符Ummm…
performsguewithidentifier:sender:
?可能重复HI,我尝试使用上面链接中给出的选项,但出现了此错误,“NSInternalInconsistencyException”,原因:“无法将类型为:UICollection的视图出列。”标识符为ProductCell的ElementKindCell-必须为标识符注册nib或类,或在情节提要的self中连接原型单元格。performSegue(带标识符:“Selection1”,发件人:self)--尝试此命令
Tried this command
if indexPath.item == 0 && indexPath.section == 0 {
self.performSegue(withIdentifier: "Selection1", sender: self)
} else if (indexPath.item == 1 && indexPath.section == 0 ){
self.performSegue(withIdentifier: "Selection2", sender: self)
print ("Item 1 and section 0 selected")
} else {
print("Not selected ")
}
}