title: Match collection view height to height of cell
body: <p>I have a collection view subclass within a vertical stack view that I want to resize its height to fit one row of my cells perfectly inside it.</p>
  <p>I've tried many solutions on StackOverflow already including using contentSize and collectionViewContentSize which are both 0 unless I give the collectionView a constant height or a size relative to its superview (which then the contentSize is just equal to that of the constant which could be too tall or too small) but if the height is too smalls the cells are cut off at the bottom. I don't want to use static heights as I want the collection view height to be dynamic based on the rotation and size of the screen.</p>
  <p>I've seen a few posts about making a new flow layout but seeing as the current flow layout works just fine for displaying my cells do I really need to make a whole new subclass?</p>
  <p>Not really sure what code I would post here, the collection view cells themselves have another vertical stack view (which fills up the entire view) that contains 3 labels and an image view (which as a 16:9 constraint on it and it cannot be more than 250 px in width). Let me know if any information would be helpful in solving this.</p>