title: How to vertically center UICollectionView content
body: <p>I am trying to dynamically center the content of a UICollectionView, however none of the existing solutions take into account the fact that there might be more than one cell per row.</p>
  
  <p>I have tried this <a href="https://stackoverflow.com/questions/9921026/center-custom-title-in-uinavigationbar">center custom title in UINavigationBar?</a> as well as both solutions here: <a href="https://stackoverflow.com/questions/23041302/uicollectionview-vertically-centred">UICollectionView vertically Centred</a>, to no avail.</p>
  
  <p>I am quite surprised iOS offers no way of doing this by default and even more that it is not possible to get the number of rows currently being displayed (which would've solved my issue as well). Also, I cannot get the size of the content (and not simply the size of the frame) which would also have helped me achieve the desired effect.</p>
  
  <p>I have this:</p>
  
  <pre><code> --------
  |X X X X |
  |X X X X |
  |        |
  |        |
   --------
  </code></pre>
  
  <p>But I want this:</p>
  
  <pre><code> --------
  |        |
  |X X X X |
  |X X X X |
  |        |
   --------
  </code></pre>
  
  <p>Any help would be greatly appreciated,</p>
  
  <p>Many thanks.</p>