I have a UITableView that contains a list of categories (in this example, list of sports types i.e. Water and Land based)
Each cell in this table then has a list of sports associated with the type of sport displayed in a nested UICollectionView. For example, water based will have Surfing and swimming.
Think Netflix - with Vertical scrolling categories with horizontally scrollable subcategories.
Here is example JSON (Note that the JSON shown is just to describe the structure. I have in fact stored this in RealmDb)
{
"category": [
{
"title": "Sport Listings",
"category_content": [
{
"title": "Water Based",
"category_content": [
{
"title": "Surfing"
}, {
"title": "Swimming"
}, {
"title": "Snorkelling"
}, {
"title": "Tombstoning"
}
]
},
{
"title": "Land Based",
"category_content": [
{
"title": "Football"
}, {
"title": "Rugby"
}
]
}
]
}
]
}
I have the table correctly populated with two cells ("water Based" and "Land Based") but i am now having trouble understanding how to parse the count and data to each of the tables rows' collection view so that i can set the text for each collection view delegate.
If i just set the collection view count for each table row to an random value then get each cell text to display the row index, it is displaying the correct index. I did this to eliminate any layout issues.
Does anyone have any pointers? From examples i've seen already, the nested UICollectionView count is being hardcoded instead of dynamic as same with the delegate content (same image/text)
I haven't posted any code as it has become a complete mess whilst i've tried to figure it out. If needed i can strip it back and put it up here.