I have a NSCollectionView
in my NSViewController
and I pass the data as follow:
func collectionView(_ collectionView: NSCollectionView, itemForRepresentedObjectAt indexPath: IndexPath) -> NSCollectionViewItem {
guard let item = collectionView.makeItem(withIdentifier: NSUserInterfaceItemIdentifier("ExploreMainCollectionItem"), for: indexPath) as? ExploreMainCollectionItem else { fatalError() }
item.categoryName.stringValue = exploreData.exploreCategories[indexPath.item].name
item.exploreCategoryIndex = indexPath.item
return item
}
In the NSCollectionViewItem
, I have another NSCollectionView
. When I try to use the data passed from previous VC, it is not what I passed and always the default value.
I tried reloading the collectionview inside a didSet
on the exploreCategoryIndex
and it has changed values but when it goes to the collectionview methods, it is always the default value of exploreCategoryIndex
.