title: Reload data Collection View inside Table view Cell (Swift)
body: <p>I came across a problem with a nested Collection View inside a Table View Cell. The content is uploaded from an online database and it takes a while to fetch the data. My question is how to keep reloading data for the Collection View until the content is fetched from the online database and then display it.</p>
  
  <pre><code>class DiscoverViewCell: UITableViewCell {
      @IBOutlet weak var categoryLabel: UILabel!
      @IBOutlet weak var _collectionView: UICollectionView!
      @IBAction func seeMoreAction(_ sender: Any) {
      }
  
  }
  class MovieCollectionViewCell: UICollectionViewCell {
      @IBOutlet weak var moviePicture: UIImageView!
      @IBOutlet weak var movieTitleLabel: UILabel!
      func updateCollectionCell(movie: MovieModel){
          moviePicture.image = movie.poster
          movieTitleLabel.text = movie.name
      }
  
  }
  func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -&gt; UICollectionViewCell {
      guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "MovieCell", for: indexPath) as? MovieCollectionViewCell else {
          return UICollectionViewCell()
      }
  
      cell.updateCollectionCell(movie: movieArray[indexPath.item])
      return cell
  }
  override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
      guard let cell = tableView.dequeueReusableCell(withIdentifier: "DiscoverCell") as? DiscoverViewCell else {
          return UITableViewCell()
      }
  
      cell.categoryLabel.text = categories[indexPath.item]
      setUpCell(cell)
      return cell
  }
  </code></pre>
  
  <p>Also, how is it possible to display different Collection Views content  inside Table View Cells depending of a label which is inside each Table View Cell but separated from Collection View.
  <a href="https://i.stack.imgur.com/FwKBq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FwKBq.png" alt="Storyboard here"></a></p>