作者热门文章
- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
我正在使用 IGListStackedSectionController,我想知道如何将多个对象传递给任何给定的 child 。
我有这样一个场景:
let sectionController = IGListStackedSectionController(sectionControllers: [
WorkingRangeSectionController(),
DisplaySectionController(),
HorizontalSectionController(),
])!
假设我想在第一部分放置一个动态标题,在第二部分放置一组图像,在最后一部分放置一组不同的图像。
我该怎么做?
非常感谢!
最佳答案
简答:
你不能这样做。相同的对象被传递给所有子部分 Controller 。
长答案:
您可以将所有必要的数据组合到一个类中,例如:
class Model {
var title = ""
var images = [UIImage]()
var otherImages = [UIImage]()
}
您还需要根据需要实现IGListDiffable
协议(protocol)。
在GitHub 上的IGListKit
示例中有IGListStackedSectionController
的简短示例.
关于ios - 如何将多个对象传递给 IGListKit Section Controller,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41796937/
我是一名优秀的程序员,十分优秀!