title: UICollectionView moveItemAtIndexPath:toIndexPath: issues moving items not on screen
body: <p>I'm trying to animate a re-sort of items in UICollectionView on iOS 6.</p>
  
  <p>I wrote this code:</p>
  
  <pre><code>    NSMutableDictionary *from = [NSMutableDictionary dictionaryWithCapacity:self.count];
      for (int ii = 0; ii &lt; self.count; ii++) {
          MyItem item = [self getItemAtIndex:(NSInteger)ii];
          [from setObject:[NSNumber numberWithInt:ii] forKey:[NSNumber numberWithInt:item.id]];
      }
  
      [self sort];
  
      [self.collectionView performBatchUpdates:^{
          for (int ii = 0; ii &lt; self.count; ii++) {
              MyItem item = [self getItemAtIndex:(NSInteger)ii];
              NSNumber *prevPos = (NSNumber *)[from objectForKey:[NSNumber numberWithInt:item.id]];
              if ([prevPos intValue] != ii) {
                  NSIndexPath *from = [NSIndexPath indexPathForItem:prevPos.intValue inSection:0];
                  NSIndexPath *to = [NSIndexPath indexPathForItem:ii inSection:0];
                  [self.collectionView moveItemAtIndexPath:from toIndexPath:to];
              }
          }
      } completion:nil];
  </code></pre>
  
  <p>So first, I'm saving all the current locations of the items in a dictionary, then I'm sorting the items into new positions, then I'm going over all items, and moving them from the old position to the new one.</p>
  
  <p>This works great when all items are displayed on the screen, but if the the list if longer then 10 which makes some items not currently visible (since they are above or below the visible section of the list), it causes these items to suddenly pop into existence in visible indexes and get animated into other places, and when the animation stops they are hidden.
  This looks really bizarre as there are items that appear on top of others...</p>
  
  <p>Is this an issue with iOS 6 UICollectionView, and am I doing something wrong here?</p>