Merge branch 'develop' into prototype/containers

# Conflicts:
#	CoreStore.xcodeproj/project.pbxproj
#	Sources/DataStack+Transaction.swift
This commit is contained in:
John Estropia
2022-01-12 16:58:10 +09:00
146 changed files with 2645 additions and 10235 deletions
+13 -1
View File
@@ -412,6 +412,11 @@ public /*abstract*/ class BaseDataTransaction {
// MARK: 3rd Party Utilities
/**
An arbitrary value that identifies the source of this transaction. Callers of the transaction can provide this value through the `DataStack.perform(...)` methods.
*/
public let sourceIdentifier: Any?
/**
Allow external libraries to store custom data in the transaction. App code should rarely have a need for this.
```
@@ -438,7 +443,13 @@ public /*abstract*/ class BaseDataTransaction {
internal var isCommitted = false
internal var result: (hasChanges: Bool, error: CoreStoreError?)?
internal init(mainContext: NSManagedObjectContext, queue: DispatchQueue, supportsUndo: Bool, bypassesQueueing: Bool) {
internal init(
mainContext: NSManagedObjectContext,
queue: DispatchQueue,
supportsUndo: Bool,
bypassesQueueing: Bool,
sourceIdentifier: Any?
) {
let context = mainContext.temporaryContextInTransactionWithConcurrencyType(
queue == .main
@@ -449,6 +460,7 @@ public /*abstract*/ class BaseDataTransaction {
self.context = context
self.supportsUndo = supportsUndo
self.bypassesQueueing = bypassesQueueing
self.sourceIdentifier = sourceIdentifier
context.parentTransaction = self
context.isTransactionContext = true