I am stumped on this. Here is my scenario. In my Appdelegate, I am creating
As for me the issue was connected to the Index Set - where to insert sections. 1. I've inserted Sections 0..<10 (10 sections) 2. I was trying to insert Sections to IndexSet 9..<19. But appending the new objects to the end of the dataSource array. Correct Index set should be (10..<20)
Thus the last section was still expecting the number of rows from Section 9. But in data source - it was at index 19.
collectionView?.insertSections(IndexSet(integersIn: startIndex..<(startIndex + series.count)))