This commit is contained in:
John Estropia
2021-05-08 11:51:53 +09:00
parent 223707159c
commit 037fd98524
5 changed files with 364 additions and 41 deletions

View File

@@ -232,6 +232,22 @@ extension NSManagedObjectContext {
self.refreshAllObjects()
}
@nonobjc
internal func merge(fromPersistentHistory transactions: [NSPersistentHistoryTransaction]) {
for transaction in transactions {
guard let userInfo = transaction.objectIDNotification().userInfo else {
continue
}
NSManagedObjectContext.mergeChanges(
fromRemoteContextSave: userInfo,
into: [self]
)
}
}
// MARK: Private