1 Reply
      Latest reply on Jan 29, 2019 3:06 PM by Claude31
      BurierA Level 1 Level 1 (0 points)

        I was do that by tag property for collectionview in each tableviewRow, but now when I grouped tableviewRows inside section, I feel confused!!! any help please!

        • Re: how to configure data source of collectionView inside tableViewCell and the tableViewCell grouped by sections
          Claude31 Level 8 Level 8 (5,485 points)

          You need to think logically about your data hierarchy.

           

          If I understand well:

          You have a tableView with sections

          In each section you have several rows

          In each row, you have a collection view.

           

          Is it exact ?

           

          If so, I would organize data like this (you can find better names, but they should be easy to understand):

          for a row: an array to contain the data for items of cellection view

          typealias ArrayForRow = [ItemOfCollectionView]

           

          For a section: an array of ArrayForRow

          typealias ArrayForSection = [ArrayForRow]

           

          And finally, the table: an array of ArrayForSection: that is the dataSource

          typealias ArrayForTable = [ArrayForSection]

           

          So, your data are

          var dataSource : ArrayForTable

           

          Take care when you initialize.

           

          Now, to get the item collItem, in row nRow of section sect, you will call

          dataSource[sect] [nRow] [collItem]

           

          Hope that helps.