title: Swift NSCollectionView flow from bottom to top
body: <p>I am workin on a messaging client for macOS, written in Swift. I use an NSScrollView with an NSCollectionView as the documentView to present the messages. Currently, I have implemented infinite scrolling, but now the problem is that the collectionView loads the cells starting at the top and works its way down – the default behavior for an NSCollectionView. Instead, I need it to start at the bottom and work its way up – the way that a typical messaging application displays messages.</p>
  
  <p>Solutions I have tried:</p>
  
  <ul>
  <li>Scrolling to the bottom of the collectionView as soon as the view loads or the user selects a different conversation. This solution is visibly janky and truly messes up infinite scrolling.</li>
  <li>Overriding the isFlipped variable in the scrollView, the scrollView's contentView, and the collectionView. Doing this has had zero visible effect on any of the views.</li>
  <li>Rotating the entire scrollView, collectionView, contentView, or collectionView cells by pi radians. As a desperate measure, I attempted to rotate the entire scrollView and was not able to do that nor rotate any of the collectionView items. I did something along the lines of <code>wantsLayer = true
  layer!.setAffineTransform(CGAffineTransform(rotationAngle: .pi))
  updateLayer()
  setNeedsDisplay(frameRect)</code>. This again has no visible affect.</li>
  </ul>
  
  <p>What's the best way to go about getting the NSCollectionView to go from bottom to top? By the way, I am not using Storyboards.</p>