0
在最簡單的例子,我可以證明,我試過,我試圖從UICollectionView
刪除項目,但我總是得到一個錯誤的不一致:我該如何做到這一點UICollectionView.deleteItemsAtIndexPaths在Swift中正確?
'NSInternalInconsistencyException', reason: 'attempt to delete item 0 from section 1, but there are only 1 sections before the update'
self.collectionView!.performBatchUpdates({
self.collectionView?.deleteItemsAtIndexPaths([NSIndexPath(forItem: 0, inSection: 1) ])
}, completion: nil)
如果你能告訴我一個完整的方法的完整工作示例,這將是有益的。
只是爲了澄清,你其實只需要在您的收藏視圖中的一個部分?如果是這樣,你需要NSIndexPath(forItem:0,inSection:0) – geraldWilliam