ios - MVC : Where do I place custom UICollectionCell

标签 ios objective-c swift model-view-controller

我是移动领域开发的新手,我对我的项目有一个架构问题:

自定义 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/

相关文章:

ios - ipad/iphone,安全应用程序分发

objective-c - Objective-C : How to resolve Leak in Code (results from Instrument)

ios - 导航 Controller 中的静态 barButtonItems?

swift - 如何在 CollectionView 中选择单元格图像然后转到 ViewController

ios - 分页时如何向 UITableView 添加行?

ios - UIScrollView 不工作/宽度和高度错误

iOS Storyboard 传递数据

ios - 我可以将 m3u 文件转换到 Chromecast 吗?

ios - leftcalloutaccessoryView 取整个注解View

objective-c - const 值上的链接器错误