mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-01-16 14:06:53 +01:00
Merge branch 'develop' into prototype/Swift_3_2
# Conflicts: # Sources/AttributeProtocol.swift # Sources/DynamicSchema+Convenience.swift # Sources/ImportableAttributeType.swift # Sources/Relationship.swift # Sources/RelationshipProtocol.swift # Sources/Transformable.swift # Sources/Value.swift
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
Pod::Spec.new do |s|
|
||||
s.name = "CoreStore"
|
||||
s.version = "4.0.5"
|
||||
s.version = "4.1.0"
|
||||
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"
|
||||
|
||||
@@ -54,7 +54,7 @@ public extension CoreStore {
|
||||
}
|
||||
|
||||
/**
|
||||
Using the `defaultStack`, performs a transaction synchronously where `NSManagedObject` or `CoreStoreObject` creates, updates, and deletes can be made. The changes are commited automatically after the `task` closure returns. On success, the value returned from closure will be the return value of `perform(synchronous:)`. Any errors thrown from inside the `task` will be rethrown from `perform(synchronous:)`. To cancel/rollback changes, call `try transaction.cancel()`, which throws a `CoreStoreError.userCancelled`.
|
||||
Using the `defaultStack`, performs a transaction synchronously where `NSManagedObject` or `CoreStoreObject` creates, updates, and deletes can be made. The changes are commited automatically after the `task` closure returns. On success, the value returned from closure will be the return value of `perform(synchronous:)`. Any errors thrown from inside the `task` will be thrown from `perform(synchronous:)`. To cancel/rollback changes, call `try transaction.cancel()`, which throws a `CoreStoreError.userCancelled`.
|
||||
|
||||
- parameter task: the synchronous non-escaping closure where creates, updates, and deletes can be made to the transaction. Transaction blocks are executed serially in a background queue, and all changes are made from a concurrent `NSManagedObjectContext`.
|
||||
- parameter waitForAllObservers: When `true`, this method waits for all observers to be notified of the changes before returning. This results in more predictable data update order, but may risk triggering deadlocks. When `false`, this method does not wait for observers to be notified of the changes before returning. This results in lower risk for deadlocks, but the updated data may not have been propagated to the `DataStack` after returning. Defaults to `true`.
|
||||
|
||||
@@ -95,7 +95,7 @@ public extension DataStack {
|
||||
}
|
||||
|
||||
/**
|
||||
Performs a transaction synchronously where `NSManagedObject` or `CoreStoreObject` creates, updates, and deletes can be made. The changes are commited automatically after the `task` closure returns. On success, the value returned from closure will be the return value of `perform(synchronous:)`. Any errors thrown from inside the `task` will be rethrown from `perform(synchronous:)`. To cancel/rollback changes, call `try transaction.cancel()`, which throws a `CoreStoreError.userCancelled`.
|
||||
Performs a transaction synchronously where `NSManagedObject` or `CoreStoreObject` creates, updates, and deletes can be made. The changes are commited automatically after the `task` closure returns. On success, the value returned from closure will be the return value of `perform(synchronous:)`. Any errors thrown from inside the `task` will be thrown from `perform(synchronous:)`. To cancel/rollback changes, call `try transaction.cancel()`, which throws a `CoreStoreError.userCancelled`.
|
||||
|
||||
- parameter task: the synchronous non-escaping closure where creates, updates, and deletes can be made to the transaction. Transaction blocks are executed serially in a background queue, and all changes are made from a concurrent `NSManagedObjectContext`.
|
||||
- parameter waitForAllObservers: When `true`, this method waits for all observers to be notified of the changes before returning. This results in more predictable data update order, but may risk triggering deadlocks. When `false`, this method does not wait for observers to be notified of the changes before returning. This results in lower risk for deadlocks, but the updated data may not have been propagated to the `DataStack` after returning. Defaults to `true`.
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>4.0.5</string>
|
||||
<string>4.1.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
|
||||
@@ -62,7 +62,7 @@ extension NSManagedObjectContext: FetchableSource, QueryableSource {
|
||||
|
||||
return object
|
||||
}
|
||||
return T.cs_fromRaw(object: existingRawObject)
|
||||
return type(of: object).cs_fromRaw(object: existingRawObject)
|
||||
}
|
||||
catch {
|
||||
|
||||
|
||||
@@ -50,13 +50,11 @@ public struct Where: FetchClause, QueryClause, DeleteClause, Hashable {
|
||||
*/
|
||||
public static func && (left: Where, right: Where?) -> Where {
|
||||
|
||||
if right != nil {
|
||||
return left && right!
|
||||
}
|
||||
else {
|
||||
if let right = right {
|
||||
|
||||
return left
|
||||
return left && right
|
||||
}
|
||||
return left
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -67,13 +65,11 @@ public struct Where: FetchClause, QueryClause, DeleteClause, Hashable {
|
||||
*/
|
||||
public static func && (left: Where?, right: Where) -> Where {
|
||||
|
||||
if left != nil {
|
||||
if let left = left {
|
||||
|
||||
return left && right
|
||||
}
|
||||
else {
|
||||
|
||||
return right
|
||||
}
|
||||
return right
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -92,13 +88,11 @@ public struct Where: FetchClause, QueryClause, DeleteClause, Hashable {
|
||||
*/
|
||||
public static func || (left: Where, right: Where?) -> Where {
|
||||
|
||||
if right != nil {
|
||||
return left || right!
|
||||
}
|
||||
else {
|
||||
if let right = right {
|
||||
|
||||
return left
|
||||
return left || right
|
||||
}
|
||||
return left
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -109,13 +103,11 @@ public struct Where: FetchClause, QueryClause, DeleteClause, Hashable {
|
||||
*/
|
||||
public static func || (left: Where?, right: Where) -> Where {
|
||||
|
||||
if left != nil {
|
||||
if let left = left {
|
||||
|
||||
return left || right
|
||||
}
|
||||
else {
|
||||
|
||||
return right
|
||||
}
|
||||
return right
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user