I have a UICollectionView that shows one page/cell at the time, paging is enabled. Cells are custom and they are containing scrollView for image as upper half and WebView for lower half. WebView contains text with some linked words, link when clicked opens modal textView which covers bottom half.
First i had a problem when webView (and just webView) was clicked (anywhere not just link words) and when i wanted to slide to another page, next page/cell was black(color of collectionView.backgroundColor
) but when printed collectionView.visibleCells
it existed. Later from coordinates I found out that second cell has the same coordinates as the third one should have.
UICollectionView cellForItemAt indexPath is skipping row indexes in iOS 10
I followed this answer because he had the same problem and set
collectionView.isPrefetchingEnabled = false
It fixed the blank page, but another problem revealed itself.
Now when i click on webView, that cell behaves like it is removed from collection, i can click on page and get response and everything but none of collectionView callback methods are called, nor willDisplay when i came back to that page, nor didEndDisplaying when i slide out.
I need to close modal textView if opened, when page is not visible.
When i click on scrollview/imageView and then slide everything works fine.
If i click on webView on some other page, the first one starts reacting.