Prevent UICollectionView to scroll while inserting items on top
<p>In my iOS app I have a UICollectionView that updates its content dynamically from server. Let's suppose there are 10 cells (index 0-9) in UIollectionView, when i download other 10 object, i insert them at index (0-9), shifting old items to index (10-19).</p>

<p>My goal would be to invalidate UICollectionView animation so, if i had element at index 3 at the top position, when i add other 10 items, they're added as top items but i see again the same item showed previously (that after update will be at index 13).</p>

<p>I tried wrapping UICollectionView items insert in UIView.performWithoutAnimation method or using this code:</p>

<pre><code>UIView.setAnimationsEnabled(false)

// insert items in collection view using perform batch updates

UIView.setAnimationsEnabled(true)
</code></pre>

<p>But result is still not good and my UICollectionView still scroll 'random' when i add items on top range.</p>