FetchedResultsController: don’t notify delegate when there is no change

This commit is contained in:
Gwendal Roué committed 2016-03-16 20:05:13 +01:00
1 parent d5d467192d
commit 09abd1e5cd
1 file changed
+3
@@ -317,6 +317,9 @@ extension FetchedResultsController : TransactionObserverType {
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)) {
let oldItems = self.fetchedItems!
let changes = FetchedResultsController.computeChanges(fromRows: oldItems, toRows: newItems, identityComparator: self.identityComparator)
guard !changes.isEmpty else {
return
}
dispatch_async(dispatch_get_main_queue()) {
self.delegate?.controllerWillUpdate(self)