title: Collection View inside Table View Cell Slow Scroll Performance
body: <p>I have checked, tried many solutions on stackoverflow and from many website I searched. </p>
  
  <p>My problem: I have a collection view inside table view cell. My data must be loaded 1 time in table view ( viewdidload). </p>
  
  <p>When I pass data to collection view inside table cells, it's not appear because I need to reload collection view again.</p>
  
  <p>So I do: Data -> inside cellforrow of table view -> Pass to collection view -> cell.collectionView.reloadData()</p>
  
  <p><strong>This cause a problem about scroll performance:</strong> collectionView.reloadData() call over and over again when I scroll ( this right because of resuable cells architecture of table view.</p>
  
  <p>Here my code in cellforrow of tableView: </p>
  
  <pre><code>let cell = tableView.dequeueReusableCell(withIdentifier: SubCategoryCellID) as! SubCategoryCell
          if isFetched {
              cell.shimmeringView.isShimmering = false
              cell.shimmeringImageView.isHidden = true
              cell.shimmeringView.isHidden = true
              cell.listLocation = nestedSubLocation[indexPath.item]
              cell.collectionView.reloadData()
          }else {
              return cell
          }
  </code></pre>
  
  <p><em>Solutions I tried:</em> 
  + Create static cells and get cells to display in cellForRow (it's totally fix scroll performance but I think it not good for memory management and it's not working if parent is collection view).
   + Reload data when scroll stop: it's still need to reloadData in loading first time and wrong data if I dont reload again.</p>
  
  <p>To fix that, anyone have an clever approach to fix scroll performance ? </p>