tidy up (WIP: queue check for NSManagedObjectContext property updates)

This commit is contained in:
John Estropia
2016-01-08 20:44:42 +09:00
parent 762b877879
commit 3e601c1328
4 changed files with 39 additions and 25 deletions

View File

@@ -55,6 +55,15 @@ internal extension NSManagedObjectContext {
}
}
internal func isRunningInAllowedQueue() -> Bool {
guard let parentTransaction = self.parentTransaction else {
return false
}
return parentTransaction.isRunningInAllowedQueue()
}
internal func temporaryContextInTransactionWithConcurrencyType(concurrencyType: NSManagedObjectContextConcurrencyType) -> NSManagedObjectContext {
let context = NSManagedObjectContext(concurrencyType: concurrencyType)