ios - Using deep index paths in UICollectionView data source -
i trying uicollectionview's data source data structure (for reasons) more 2 layers deep. in other words, data can broken sections, not of sections contain items. contain arrays of items (or "nested sections", speak). these items can referenced index path three indices long (3.2.4, instance), uicollectionview's data source methods seem support index paths two indices long.
all of uicollectionview apis use nsindexpaths reference collection view items, in theory should work number of indices. challenge getting collection view "know" ask cells, layout attributes, etc. items @ these deeper indices when data source protocol provides collectionview:numberofitemsinsection:
, numberofsectionsincollectionview:
specify indices needs ask for.
is there way around doesn't require me (a) subclass uicollectionview, apple explicitly discourages (second point under "tips implementing custom layouts") or (b) flatten data structure, less ideal, , seems unnecessarily limited given apis uicollectionview provides?
it doesn't make logical sense in scheme of standard collectionview (or tableview) have 3 tier index. i've seen cool tableviews have "expanding" cells work in same way you're describing. it's object representing expanding cell tells table has multiple items available.
i can't understand how collectionview supposed end product. if encountering arrays @ index paths, trying represent? don't want inform design why not show 1 item @ particular index, , when user selects it, expand or show view subsequent items?
Comments
Post a Comment