Ren*_*cki 4 ios instagram swift iglistkit
我正在使用IGListStackedSectionController,我想知道如何将多个对象传递给任何给定的子节点.
我有这样的场景:
let sectionController = IGListStackedSectionController(sectionControllers: [
WorkingRangeSectionController(),
DisplaySectionController(),
HorizontalSectionController(),
])!
Run Code Online (Sandbox Code Playgroud)
假设我想在第一部分放置动态标题,在第二部分放置一个图像数组,在最后一部分放置不同的图像数组.
我该怎么办?
非常感谢!
简短回答:
你不能这样做.相同的对象传递给所有子控制器.
答案很长:
您可以将所有必要的数据组合到一个类中,例如:
class Model {
var title = ""
var images = [UIImage]()
var otherImages = [UIImage]()
}
Run Code Online (Sandbox Code Playgroud)
您还需要IGListDiffable根据需要实施协议.
有一种简单的例子IGListStackedSectionController在IGListKit上例GitHub上.
| 归档时间: |
|
| 查看次数: |
941 次 |
| 最近记录: |