我是移动领域开发的新手,我对我的项目有一个架构问题:
自定义 UICollectionViewCell 的正确位置在哪里?
本能地,我会把它放在 (V)view 下。
编辑
我会这样使用它:
func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
var customCell: CustomCell = collectionView.dequeueReusableCellWithReuseIdentifier(CustomCell.identifier, forIndexPath: indexPath) as! CustomCell
customCell.setupWithSomeOtherObject(..)
return customCell;
}
最佳答案
放置自定义 UICollectionViewCell
的正确位置是您的 View 组,因为单元格是 View ,它是 UIView
的子类,所以是的,这是正确的地方。
关于ios - MVC : Where do I place custom UICollectionCell,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30232798/