【发布时间】:2016-01-13 11:45:10
【问题描述】:
我尝试创建一个UICollectionView,该UICollectionView 应该在特定单元格中打开。
我的方法是存储所有单元格:
func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) ->
UICollectionViewCell {
// my code
cells.append(cell)
return cell
}
然后在viewDidAppear中找到想要的单元格:
let result:[MyCell] = cells.filter{ $0.myProperty!.uuid == selectedUUID }
很遗憾,在单元格数组中找不到所需的单元格,因为尚未存储所有单元格。
我是朝着正确的方向前进还是需要不同的解决方案?
编辑:删除误导性信息
【问题讨论】:
标签: ios uicollectionview swift2 uicollectionviewcell