From 093c1d410fc4af749bae401d4e8a1637794131ca Mon Sep 17 00:00:00 2001 From: John Rommel Estropia Date: Sun, 23 Aug 2015 14:02:27 +0900 Subject: [PATCH] temporarily fix an Xcode 7 bug (still present as of beta 5) (temporarily fixes #12) --- CoreStore/Observing/ListMonitor.swift | 5 ++++- CoreStore/Observing/ObjectMonitor.swift | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CoreStore/Observing/ListMonitor.swift b/CoreStore/Observing/ListMonitor.swift index 3d3fef3..36a8b97 100644 --- a/CoreStore/Observing/ListMonitor.swift +++ b/CoreStore/Observing/ListMonitor.swift @@ -779,7 +779,7 @@ extension ListMonitor: FetchedResultsControllerHandler { ] ) - case .Move: + case .Move where indexPath != newIndexPath: NSNotificationCenter.defaultCenter().postNotificationName( ListMonitorDidMoveObjectNotification, object: self, @@ -789,6 +789,9 @@ extension ListMonitor: FetchedResultsControllerHandler { UserInfoKeyNewIndexPath: newIndexPath! ] ) + + default: + break } } diff --git a/CoreStore/Observing/ObjectMonitor.swift b/CoreStore/Observing/ObjectMonitor.swift index f06d257..f6f446d 100644 --- a/CoreStore/Observing/ObjectMonitor.swift +++ b/CoreStore/Observing/ObjectMonitor.swift @@ -179,7 +179,7 @@ public final class ObjectMonitor { let fetchRequest = NSFetchRequest() fetchRequest.entity = object.entity - fetchRequest.fetchLimit = 1 + fetchRequest.fetchLimit = 0 fetchRequest.resultType = .ManagedObjectResultType fetchRequest.sortDescriptors = [] @@ -288,7 +288,7 @@ extension ObjectMonitor: FetchedResultsControllerHandler { userInfo: [UserInfoKeyObject: anObject] ) - case .Update: + case .Update, .Move where indexPath == newIndexPath: NSNotificationCenter.defaultCenter().postNotificationName( ObjectMonitorDidUpdateObjectNotification, object: self,