title: TableViewHeader with dynamic height
body: <p>I have a <code>UITableViewHeader</code> which contains a <code>UILabel</code> (dynamic height - can be one line or mulitple lines) and a custom <code>UICollectionView</code> which shows a UILabel in each <code>UICollectionViewCell</code>. Depending on which device is used, these <code>UICollectionViewCells</code> can span over one line or they can be on two or three lines. That all doesn't matter that much.</p>
  
  <p>My problem is in the <code>heightForHeaderInSection</code> method. As this gets called before the frame is set (<code>print(headerView.frame.height)</code> returns 0.0), I can't properly return the correct height. I am trying to access the headerView.frame.height so it can be set dynamically, but I fail to do so. I have looked into <code>viewDidLayoutSubviews</code>, but then I would have to store it as a <code>CGFloat</code> and force <code>heightForHeaderInSection</code> to be called again.</p>
  
  <p>I am pretty sure there must be a way to do this more easily. I also tried looking in to <code>UITableView.automaticDimension</code>, but this hasn't brought me to the resolution either. Any suggestions?</p>