title: Table views inside collection view cells?
body: <h2><strong>The Issue</strong></h2>
  
  <p>I am attempting to use a collection view in a view controller for cards. When a user taps on a card, it expands. At all times, I have a tableview in each card, whether it is expanded or not. I have the data loading in the table views, but only when I tap on a card to expand it or if I scroll collection view cards offscreen and back onscreen. What is a cleaner workflow to doing this that puts tableviews in each collection view cell?</p>
  
  <p>This is in my main view controller:</p>
  
  <pre><code>func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -&gt; UICollectionViewCell {
  
      let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "productionBinderCell", for: indexPath) as? ProductionBinderCollectionViewCell
  
      let suck = cell?.detailsTableView.cellForRow(at: IndexPath(row: 0, section: 0)) as? DescriptionTableViewCell
  
      suck?.descriptionText.text = productions[indexPath.row].productionDescription
  
      cell?.detailsTableView.reloadData()
  
      cell?.layer.shouldRasterize = true
      cell?.layer.rasterizationScale = UIScreen.main.scale
  
      let title = productions[indexPath.row].productionTitle
  
      let luck = productions[indexPath.row].productionImage
  
      let zuck = UIImage(data:luck!)
  
      cell?.productionTitle.text = title
  
      cell?.productionFeaturedImage.image = zuck
  
      cell?.productionColorTint.tintColor = UIColor.blue
  
      let backbtn = cell?.viewWithTag(1)
  
      backbtn?.isHidden = true
  
      return cell!
  }
  </code></pre>
  
  <p>This is in a subclass of the tableview:</p>
  
  <pre><code>override func layoutSubviews() {
      super.layoutSubviews()
      self.dataSource = self
      self.delegate = self
  }
  
  func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
      let cell = tableView.dequeueReusableCell(withIdentifier: "productionDescription", for: indexPath) as? DescriptionTableViewCell
      return cell!
  }
  </code></pre>
  
  <p>This is in a subclass of the tableview cell I am concerned with. It only shows the uilabel text when scrolling offscreen or tapping on the collection view cell:</p>
  
  <pre><code>class DescriptionTableViewCell: UITableViewCell {
  
  @IBOutlet var descriptionText: UILabel!
  
  override func awakeFromNib() {
      super.awakeFromNib()
      }
  
  override func setSelected(_ selected: Bool, animated: Bool) {
      super.setSelected(selected, animated: animated)
  
      // Configure the view for the selected state
      }
  
  }
  </code></pre>
  
  <p>Maybe I shouldn't be using a tableview at all? Thank you very much to all who help. I am very open to criticism and love learning from my mistakes (a little too often). :)</p>