gpt4 book ai didi

ios - 如何将多个对象传递给 IGListKit Section Controller

转载 作者:搜寻专家 更新时间:2023-10-31 08:22:20 25 4
gpt4 key购买 nike

我正在使用 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com