title: Bad collectionview content offset after dismissing a modal landscape view controller (iOS 8)
body: <p>I have an app that allow the four possible orientations. The <code>rootViewController</code> of the app is a <code>UITabBarController</code> subclass that only allows portrait orientation:</p>
  
  <pre><code>- (NSUInteger)supportedInterfaceOrientations {
    returnUIInterfaceOrientationMaskPortrait;
  }
  </code></pre>
  
  <p>On one of the tabs I have a view controller with a collection view. From there I can present a modal view controller that allow portrait and landscape orientations.
  When the user dismisses this modal view controller I have to scroll the collection view to a specific <code>indexPath</code>. I do this in the presenting view controller with the following code:</p>
  
  <pre><code>- (void)userDidCloseArtworkZoomWithOffset:(NSInteger)offset {
  
    NSIndexPath *newIndexPath = [NSIndexPath indexPathForItem:self.artworkZoomInitialIndexPath.item + offset inSection:0];
    self.artworkZoomInitialIndexPath = nil;
  
    [self.collection scrollToItemAtIndexPath:newIndexPath atScrollPosition:UICollectionViewScrollPositionCenteredHorizontally animated:NO];
    [self dismissViewControllerAnimated:YES completion:nil];
  }
  </code></pre>
  
  <p>When I close the modal view controller in portrait orientation everything works well. But when the modal view controller is in landscape orientation, the scroll does not work well and doesn't show the cell it should.</p>
  
  <p>The collection view uses a flowLayout.</p>
  
  <p>This only happens on iOS 8. On iOS 7 it works well.</p>
  
  <p>What can be happening?</p>