【发布时间】:2018-05-28 13:48:40
【问题描述】:
我有一个 UIViewController,其中我有一个 UITableView,而在 tableViewCell 中我有一个 collectionView。如何让我的 ViewController 成为 CollectionView 的代表,以使自己与 MVC 架构保持一致?
【问题讨论】:
-
到目前为止您尝试过什么?你能分享一些代码吗?
-
你想对代理做什么?
-
据我了解,我认为您希望在 collectionView 中执行操作时希望使用 Delegates 在 UIviewController 中发生更改?
-
@iOSGeek 是的。我想在我的视图控制器而不是我的 TableViewCell 中处理 CollectionView 单元格点击。
-
@BagusCahyono 我目前已将 UITableViewCell 作为 CollectionView 的代表,因为我的 collectionView 在 tableviewcell 内。虽然我知道这不是正确的方法,因此寻求更好的解决方案。我想在我的视图控制器中处理 collectionView 单元格点击。
标签: ios swift uitableview uicollectionview