title: Why doesn't my uicollectionview move with the underlying uiscrollview?
body: <p>I have a simple iOS app built in Xcode 9.2, written in Swift 4. I have a working, vertical scroll view with a working, horizontally-scrolling collection view placed on top of it.  Scrolling works as I'd like, except that the collection view does not move with the rest of the content when scrolling vertically (see screenshots, where collection view stays in same absolute position, whether scrolled to top or bottom of underlying view).</p>
  
  <p><img src="https://i.stack.imgur.com/pmEil.png" alt="screenshot: scrolled to the top"></p>
  
  <p><img src="https://i.stack.imgur.com/eCHKw.png" alt="screenshot: scrolled to the bottom"></p>
  
  <p><img src="https://i.stack.imgur.com/ijVXk.png" alt="screenshot: views hierarchy"></p>
  
  <p>I tried following the steps in the second answer to <a href="https://stackoverflow.com/questions/48692425/uicollectionview-and-uiview-into-uiscrollview">this question</a>, but when I add constraints to the collection view as described, the collection view stops appearing in the simulation and vertical scrolling stops working.</p>
  
  <p>If possible, I would like to have the collection view move up and down with the rest of the content when scrolling.</p>