UICollectionViewCell overlapping
<p>I have a horizontally scrollable UICollectionView, I am setting the horizontal direction using UICollectionViewFlowLayout. </p>

<p>When I delete one of the cell using - </p>

<pre><code>[self.collectionView deleteItemsAtIndexPaths:selectedItemsIndexPaths];
</code></pre>

<p>I notice that on scrolling back to the first UICollectionViewCell(Which is not visible when the above cell is deleted) overlaps with the second UICollectionViewCell as shown below</p>

<p><a href="https://i.stack.imgur.com/iM9P4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iM9P4.png" alt="enter image description here"></a></p>

<p>Sometimes instead of overlapping it ends up like - </p>

<p><a href="https://i.stack.imgur.com/lI1Mw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lI1Mw.png" alt="enter image description here"></a></p>

<p>My cellForItemAtIndexPath looks like - </p>

<pre><code>ABCollectionViewCell *cell = (ABCollectionViewCell *)[cv dequeueReusableCellWithReuseIdentifier:@"abCell" forIndexPath:indexPath];

    cell.name.text = [self.categoryArray objectAtIndex:indexPath.row];
    cell.contactButton.tag = indexPath.row;

    cell.layer.cornerRadius = 5.0;
    cell.layer.borderColor = [UIColor lightGrayColor].CGColor;
    cell.layer.borderWidth = 1.0;
    cell.clipsToBounds = YES;

    return cell;
</code></pre>

<p>I have tried all the similar issues solution online but none of them seem to be working. Any help would be appreciated.</p>

<p>UICollectionViewFlowLayout - </p>

<pre><code>UICollectionViewFlowLayout *flowLayout = [[UICollectionViewFlowLayout alloc] init];
[flowLayout setScrollDirection:UICollectionViewScrollDirectionHorizontal];
flowLayout.estimatedItemSize = CGSizeMake(102.0, 102.0);
flowLayout.minimumLineSpacing = 6.0f;
flowLayout.minimumInteritemSpacing = 2.0f;
[self.collectionView setCollectionViewLayout:flowLayout];
</code></pre>