title: Populating CollectionView which is inside TableView from API
body: <p>I'm using alamofire to get data from an API stores inside an array with the help of a model class. 
  Now i want to display this data in a CollectionView that is inside a TableView. So passing that array to display the data is being a problem here is some code see if you can find the problem. </p>
  
  <p>Tell me if you want me to give you anymore information</p>
  
  <p><strong>cellforrowat of tableview</strong></p>
  
  <pre><code>if let cell = tableView.dequeueReusableCell(withIdentifier: "HeadlineRow", for: indexPath) as? HeadlineRow {
  
              let latest = self.latest[indexPath.section]
              cell.updateUI(latest: latest)
  
              return cell
          }
  </code></pre>
  
  <p><strong>tableviewcell class</strong></p>
  
  <pre><code>var latestNews = [LatestNews]()
  
  func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -&gt; UICollectionViewCell {
  
          if let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "HeadlineCell", for: indexPath) as? HeadlineCell {
  
              let latest = self.latestNews[indexPath.row]
              cell.updateUI(latest: latest)
  
              return cell
          }
  
          return UICollectionViewCell()
      }
  
      func updateUI(latest: LatestNews) {
          self.latestNews.append(latest)
      }
  </code></pre>
  
  <p><strong>collection view class</strong></p>
  
  <pre><code>func updateUI(latest: LatestNews){
  
          self.headlineImg.sd_setImage(with: URL(string: latest.thumbnail))
          headlineTextView.text = latest.headline
      }
  </code></pre>
  
  <p>So The problem basically is how do i transfer the array from MainViewController to the custom TableView class to the custom Collection View Class.</p>