title: How to make UICollectionView new cells load from bottom in Swift
body: <p>I have a collectionview to display a list of comments, but I want the cells to start displaying from bottom, a pattern seen in the WhatsApp and Telegram App for iOS (new messages starts from the bottom and populate upwards), like in the image below.
  <a href="https://i.stack.imgur.com/8I5ax.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8I5ax.png" alt="Telegram iOS Screenshot "></a></p>
  
  <p>I was searching online but couldn't find something that worked.
  I tried this code below from one answer I saw on SO but it didn't work as well.</p>
  
  <pre><code>let contentSize = collectionView.collectionViewLayout.collectionViewContentSize
      if contentSize.height &gt; collectionView.bounds.size.height {
          collectionView.contentOffset = CGPoint(x: 0, y: contentSize.height - collectionView.bounds.size.height)
      }
  </code></pre>
  
  <p>How do I achieve this?</p>