mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-03-24 02:11:26 +01:00
WIP: demo app
This commit is contained in:
@@ -311,10 +311,9 @@ public final class ListMonitor<T: NSManagedObject>: Hashable {
|
||||
|
||||
return nil
|
||||
}
|
||||
guard let sections = self.fetchedResultsController.sections
|
||||
where section < sections.count else {
|
||||
|
||||
return nil
|
||||
guard let sections = self.fetchedResultsController.sections, section < sections.count else {
|
||||
|
||||
return nil
|
||||
}
|
||||
return sections[section]
|
||||
}
|
||||
@@ -1105,8 +1104,8 @@ public final class ListMonitor<T: NSManagedObject>: Hashable {
|
||||
|
||||
self.isPersistentStoreChanging = true
|
||||
|
||||
guard let removedStores = (note.userInfo?[NSRemovedPersistentStoresKey] as? [NSPersistentStore]).flatMap(Set.init)
|
||||
where !Set(self.fetchedResultsController.fetchRequest.affectedStores ?? []).intersection(removedStores).isEmpty else {
|
||||
guard let removedStores = (note.userInfo?[NSRemovedPersistentStoresKey] as? [NSPersistentStore]).flatMap(Set.init),
|
||||
!Set(self.fetchedResultsController.fetchRequest.affectedStores ?? []).intersection(removedStores).isEmpty else {
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
@@ -341,7 +341,8 @@ extension ObjectMonitor: FetchedResultsControllerHandler {
|
||||
userInfo: [String(NSManagedObject.self): anObject]
|
||||
)
|
||||
|
||||
case .update:
|
||||
case .update,
|
||||
.move where indexPath == newIndexPath:
|
||||
NotificationCenter.default.post(
|
||||
name: Notification.Name.objectMonitorDidUpdateObject,
|
||||
object: self,
|
||||
|
||||
Reference in New Issue
Block a user