Added utility for re-faulting all objects in a transaction/dataStack

This commit is contained in:
John Rommel Estropia
2016-01-26 12:22:30 +09:00
parent f5627f0855
commit c07435e866
4 changed files with 46 additions and 0 deletions

View File

@@ -188,6 +188,19 @@ public /*abstract*/ class BaseDataTransaction {
objects.forEach { context.fetchExisting($0)?.deleteFromContext() }
}
/**
Refreshes all registered objects `NSManagedObject`s in the transaction.
*/
public func refreshAllObjectsAsFaults() {
CoreStore.assert(
self.isRunningInAllowedQueue(),
"Attempted to refresh entities outside their designated queue."
)
self.context.refreshAllObjectsAsFaults()
}
// MARK: Internal