// My data to use
let items: [Any] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ...]
/*
// UICollectionView result I want
<Section [Item1, Item2, Item3]>
<Other Section A>
<Section [Item4, Item5, Item6]>
<Other Section B>
<Section [Item7, Item8, Item9]>
<Other Section A>
<Section [Item10, Item11, Item12]>
<Other Section B>
*/
如果我的数据是象下面一个二维数组,我可以看到结果更容易。
let items: [[Any]] = [[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12] ...]
但我想我应该只使用一维数组。
因为我的项目会经常增加/删除。并需要API通信..并需要LoadMore函数..也许这些事情变得复杂,如果使用二维数组。而这个问题与其他部分的立场有关。
它可能只有一维数组?我的想法是正确的?
你如何决定哪些项目适合哪个部分?每节只有三个项目吗? – overactor
@ oractor是的。 – Byoth