Roman Siro Roman Siro - 1 year ago 330
Swift Question

UICollectionView cellForItemAt indexPath is skipping row indexes in iOS 10

I have

with horizontal scrolling and paging. When I scroll to next or previous page for the first time or change scrolling direction from left to right, value of indexPath.row in
is changing by 3 not 1. Then it works properly.
works without problems in
9. The problem occurs just in
10. Thanks.

Answer Source

Problem was with new prefetching feature of UICollectionView. Disabling of prefetching solved my problem.

if #available(iOS 10.0, *) {collectionView.isPrefetchingEnabled = false}
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download