Is there any reason that cellForItemAtIndexPath
would not get called after numberOfItemsInSection
gets called and returns a nonzero number? Would a reloadData
from a completion block affect this? I'm running into an issue in which I am trying to delete a cell through a UIAlertController
and the UI looks great, but when I go to reloadData
after the UI animation finishes numberOfItemsInSection
properly gets called with the right number of elements (the previous number of elements minus 1), yet cellForItemAtIndexPath
does not get called, so my cells don't get reloaded. Any ideas as to why this would happen?
This is on Swift 1.2
, XCode 6.4
, and any help would be greatly appreciated
Just to give a bit more information, the method I'm using to delete a cell is looking a little like:
self.collectionView.performBatchUpdates({
let indexPathCellToDelete = self.indexPath(feedCell)
self.collectionView.deleteItemsAtIndexPaths([indexPathCellToDelete])
}, completion:nil)
Would having a second reload in the completion block change anything?