title: Set height of UITableViewCell by height of UICollectionView
body: <p>I have a problem: I have <code>UITableView</code> with <code>UITableViewCell</code>, at cell I have <code>UICollectionView</code> with a different number <code>UICollectionViewCell</code>. I want to <code>UITableViewCell</code> height corresponds to the height of <code>UICollectionView</code>. 
  I see real height <code>UICollectionView</code> here:</p>
  
  <pre><code>    class TimeViewCell: UITableViewCell {
  
          @IBOutlet weak var labelTime: UILabel!
  
          var dataForShow = [String]() {
  
              didSet{
                  self.collectionView?.reloadData()
              }
          }
  
          @IBOutlet weak var collectionView: UICollectionView!
  
  
  
          override func awakeFromNib() {
              super.awakeFromNib()
  
              collectionView.delegate = self
              collectionView.dataSource = self
  
          }
  
      }
  
      extension TimeViewCell: UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout {
  
          func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -&gt; Int {
  
              return dataForShow.count
          }
  
  
          func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -&gt; UICollectionViewCell {
  
              let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "CollectionCell", for: indexPath) as! CustomCollectionCell
  
              cell.labelCollection.text = dataForShow[indexPath.row]
  
              let realValueHeightOfCollection = collectionView.contentSize.height
  
  //when print realValueHeightOfCollection I see 50.0 (if dataForShow.count &lt;4) or 110.0 (if dataForShow.count &gt;5)
  
              return cell
          }
  
      }
  </code></pre>
  
  <p>but how to pass that height to height <code>UITableViewCell</code>?</p>
  
  <pre><code>func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
  
      let cell = tableView.dequeueReusableCell(withIdentifier: "cellTime", for: indexPath) as! TimeViewCell
      let showHour = self.infoWripper.sorted(by: { $0.hour &lt; $1.hour })[indexPath.row]
  
      cell.labelTime.text = showHour.showHour()
  
      cell.dataForShow = showHour.showFullTime()
  
  
      //here may be set the height of cell?
  
      return cell
  }
  </code></pre>
  
  <p>upd Storyboard: <a href="https://i.stack.imgur.com/veMy0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/veMy0.png" alt="enter image description here"></a></p>