mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-01-16 05:56:50 +01:00
Merge branch 'develop'
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
Pod::Spec.new do |s|
|
||||
s.name = "CoreStore"
|
||||
s.version = "1.5.1"
|
||||
s.version = "1.5.2"
|
||||
s.license = "MIT"
|
||||
s.summary = "Unleashing the real power of Core Data with the elegance and safety of Swift"
|
||||
s.homepage = "https://github.com/JohnEstropia/CoreStore"
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.5.1</string>
|
||||
<string>1.5.2</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
|
||||
@@ -39,8 +39,10 @@ public final class SynchronousDataTransaction: BaseDataTransaction {
|
||||
|
||||
/**
|
||||
Saves the transaction changes and waits for completion synchronously. This method should not be used after the `commit()` method was already called once.
|
||||
|
||||
- returns: a `SaveResult` containing the success or failure information
|
||||
*/
|
||||
public func commit() {
|
||||
public func commitAndWait() -> SaveResult {
|
||||
|
||||
CoreStore.assert(
|
||||
self.transactionQueue.isCurrentExecutionContext(),
|
||||
@@ -52,7 +54,10 @@ public final class SynchronousDataTransaction: BaseDataTransaction {
|
||||
)
|
||||
|
||||
self.isCommitted = true
|
||||
self.result = self.context.saveSynchronously()
|
||||
|
||||
let result = self.context.saveSynchronously()
|
||||
self.result = result
|
||||
return result
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -197,6 +202,12 @@ public final class SynchronousDataTransaction: BaseDataTransaction {
|
||||
self.context.reset()
|
||||
}
|
||||
|
||||
@available(*, deprecated=1.5.2, renamed="commitAndWait")
|
||||
public func commit() {
|
||||
|
||||
self.commitAndWait()
|
||||
}
|
||||
|
||||
|
||||
// MARK: Internal
|
||||
|
||||
|
||||
@@ -55,6 +55,18 @@ public final class UnsafeDataTransaction: BaseDataTransaction {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Saves the transaction changes and waits for completion synchronously. For a `UnsafeDataTransaction`, multiple commits are allowed, although it is the developer's responsibility to ensure a reasonable leeway to prevent blocking the main thread.
|
||||
|
||||
- returns: a `SaveResult` containing the success or failure information
|
||||
*/
|
||||
public func commitAndWait() -> SaveResult {
|
||||
|
||||
let result = self.context.saveSynchronously()
|
||||
self.result = result
|
||||
return result
|
||||
}
|
||||
|
||||
/**
|
||||
Rolls back the transaction.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user