Terminating app due to uncaught exception ‘NSInternalInconsistencyException’, reason: ‘UICollectionView received layout attributes for a cell with an index path that does not exist: <NSIndexPath: 0x28223ea40> {length = 2, path = 0 - 1}’
open func insertItems(at indexPaths: [IndexPath])
需要注意的是在插入insertItems 之前 不能再改变UICollectionViewFlowLayout
的布局 如果需要更改UICollectionViewFlowLayout的布局
需要在执行insertItems函数后 才可以调用 UICollectionViewFlowLayout的prepare 或者 invalidateLayout