This seems to be a bug in iOS 9 (which is still beta) and is also discussed in the Apple Developer Forum
- iOS 9 CoreData NSFetchedResultsController update causes blank rows in UICollectionView/UITableView
I can confirm the problem with the iOS 9 Simulator from Xcode 7 beta 3.
I observed that for an updated managed object, the didChangeObject:
delegate method is called twice: Once with the NSFetchedResultsChangeUpdate
event and then again with the NSFetchedResultsChangeMove
event (and indexPath == newIndexPath
).
Adding an explicit check for indexPath != newIndexPath
as suggested in the above thread seems to solve the problem:
case .Move:
if indexPath != newIndexPath {
tableView.deleteRowsAtIndexPaths([indexPath!], withRowAnimation: .Fade)
tableView.insertRowsAtIndexPaths([newIndexPath!], withRowAnimation: .Fade)
}