title: How to detect scrolling to a new section in a UICollectionView?
body: <p>I am implementing an infinite-scrolling calendar. My issue is that I would like to set the current month as the title in the navigation bar and it should update while scrolling - once you pass the section header view the title should update in the nav bar.</p>
  
  <p>A possible solution would be to set the view title in the method called <code>- (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath</code> so that, when I calculate a new section Header, it also updates the title. The problem with this is that the title changes when the new section is at the bottom of the page. </p>
  
  <p><img src="https://i.stack.imgur.com/L9PvQ.png" alt="Currently displaying the Section Header as title, not optimal"></p>
  
  <p>Is there a way to know the "current section" of <code>UICollectionView</code> once the user has scrolled to it?  Or can you think of a way to improve my current solution? </p>
  
  <p>To help the readers of this post, I posted my own sample code for this question at this <a href="https://github.com/maggix/CollectionViewCalendarTest">GitHub repo</a>.</p>