Swift3 如何自定义集合视图flowlayout单元格

Swift3 如何自定义集合视图flowlayout单元格,swift3,uicollectionview,uicollectionviewcell,uicollectionviewflowlayout,Swift3,Uicollectionview,Uicollectionviewcell,Uicollectionviewflowlayout,我正在使用collection view创建电影票应用程序。我被困在集合视图中安排座位。如何自定义自定义流布局?我希望集合视图单元格的特定行中有特定数量的座位 func collectionView(collectionView:UICollectionView,cellForItemAt indexPath:indexPath)->UICollectionViewCell{ 如果collectionView==leftCollectionView{ 让cell=collectionView.

我正在使用collection view创建电影票应用程序。我被困在集合视图中安排座位。如何自定义自定义流布局?我希望集合视图单元格的特定行中有特定数量的座位

func collectionView(collectionView:UICollectionView,cellForItemAt indexPath:indexPath)->UICollectionViewCell{
如果collectionView==leftCollectionView{
让cell=collectionView.dequeueReusableCell(带有ReuseIdentifier:“leftcellid”,for:indexPath)作为!LeftSideMovieCollectionViewCell
让selectedseat=leftsideArray[indexPath.row]
如果选择Seatarray.contains(选择座位){
cell.leftMovieSeatImageView.image=UIImage.init(名为:“seatfulled”)
}否则{
cell.leftMovieSeatImageView.image=UIImage.init(名为“座椅靠背”)
}
如果indexPath.row==16 | | indexPath.row==17 | | indexPath.row==12 | | indexPath.row==13{
cell.leftMovieSeatImageView.ishiden=true
}否则{
cell.leftMovieSeatImageView.ishiden=false
}
返回单元
}如果collectionView==RightCollectionview,则为else{
让cell=collectionView.dequeueReusableCell(带有ReuseIdentifier:“rightcellid”,for:indexPath)作为!RightSideMovieCollectionViewCell
让selectedseat=rightsideArray[indexPath.row]
如果选择Seatarray.contains(选择座位){
cell.RightMovieseatImageView.image=UIImage.init(名为:“seatfulled”)
}否则{
cell.RightMovieseatImageView.image=UIImage.init(名为“座椅靠背”)
}
如果indexPath.row==18 | | indexPath.row==19 | | indexPath.row==14 | | indexPath.row==15{
cell.RightMovieseatImageView.ishiden=true
}否则{
cell.RightMovieseatImageView.ishiden=false
}
返回单元
}否则{
让cell=collectionView.dequeueReusableCell(带有reuseidentifier:“maincellid”,for:indexath)作为!MainCollectionViewCell
让selectedseat=vipSeatArray[indexPath.row]
如果选择Seatarray.contains(选择座位){
cell.mainSeatImageView.image=UIImage.init(名为:“seatfulled”)
}否则{
cell.mainSeatImageView.image=UIImage.init(名为“座椅靠背”)
}
如果indexPath.row==43 | | indexPath.row==42 | | indexPath.row==34 | | indexPath.row==33{
cell.mainSeatImageView.ishiden=true
}否则{
cell.mainSeatImageView.ishiden=false
}
返回单元
}
}

在这里,我有三个收集意见。我已经隐藏了特定的细胞。我不知道如何修改这个。可以使用单个集合视图来完成吗?任何建议都将不胜感激。

@dda我已经用代码编辑了上面的帖子……请看一看……任何帮助都将不胜感激……谢谢