fix compiler errors

This commit is contained in:
John Estropia
2019-01-31 16:50:43 +09:00
parent 9239370793
commit 41902fee2e
76 changed files with 140 additions and 151 deletions
-14
View File
@@ -2796,7 +2796,6 @@
SKIP_INSTALL = YES; SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Off; SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.2;
}; };
name = Debug; name = Debug;
}; };
@@ -2815,7 +2814,6 @@
SKIP_INSTALL = YES; SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-O"; SWIFT_OPTIMIZATION_LEVEL = "-O";
SWIFT_SWIFT3_OBJC_INFERENCE = Off; SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.2;
}; };
name = Release; name = Release;
}; };
@@ -2836,7 +2834,6 @@
SWIFT_OBJC_BRIDGING_HEADER = "CoreStoreTests/CoreStoreTests-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "CoreStoreTests/CoreStoreTests-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Off; SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.2;
}; };
name = Debug; name = Debug;
}; };
@@ -2852,7 +2849,6 @@
SDKROOT = iphoneos; SDKROOT = iphoneos;
SWIFT_OBJC_BRIDGING_HEADER = "CoreStoreTests/CoreStoreTests-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "CoreStoreTests/CoreStoreTests-Bridging-Header.h";
SWIFT_SWIFT3_OBJC_INFERENCE = Off; SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.2;
}; };
name = Release; name = Release;
}; };
@@ -2873,7 +2869,6 @@
SKIP_INSTALL = YES; SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Off; SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = 3; TARGETED_DEVICE_FAMILY = 3;
}; };
name = Debug; name = Debug;
@@ -2895,7 +2890,6 @@
SKIP_INSTALL = YES; SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-O"; SWIFT_OPTIMIZATION_LEVEL = "-O";
SWIFT_SWIFT3_OBJC_INFERENCE = Off; SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = 3; TARGETED_DEVICE_FAMILY = 3;
}; };
name = Release; name = Release;
@@ -2914,7 +2908,6 @@
SWIFT_OBJC_BRIDGING_HEADER = "CoreStoreTests/CoreStoreTests-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "CoreStoreTests/CoreStoreTests-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Off; SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = 3; TARGETED_DEVICE_FAMILY = 3;
}; };
name = Debug; name = Debug;
@@ -2933,7 +2926,6 @@
SDKROOT = appletvos; SDKROOT = appletvos;
SWIFT_OBJC_BRIDGING_HEADER = "CoreStoreTests/CoreStoreTests-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "CoreStoreTests/CoreStoreTests-Bridging-Header.h";
SWIFT_SWIFT3_OBJC_INFERENCE = Off; SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = 3; TARGETED_DEVICE_FAMILY = 3;
}; };
name = Release; name = Release;
@@ -2958,7 +2950,6 @@
SKIP_INSTALL = YES; SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Off; SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.2;
}; };
name = Debug; name = Debug;
}; };
@@ -2983,7 +2974,6 @@
SKIP_INSTALL = YES; SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-O"; SWIFT_OPTIMIZATION_LEVEL = "-O";
SWIFT_SWIFT3_OBJC_INFERENCE = Off; SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.2;
}; };
name = Release; name = Release;
}; };
@@ -3004,7 +2994,6 @@
SWIFT_OBJC_BRIDGING_HEADER = "CoreStoreTests/CoreStoreTests-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "CoreStoreTests/CoreStoreTests-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Off; SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.2;
}; };
name = Debug; name = Debug;
}; };
@@ -3025,7 +3014,6 @@
SDKROOT = macosx; SDKROOT = macosx;
SWIFT_OBJC_BRIDGING_HEADER = "CoreStoreTests/CoreStoreTests-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "CoreStoreTests/CoreStoreTests-Bridging-Header.h";
SWIFT_SWIFT3_OBJC_INFERENCE = Off; SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.2;
}; };
name = Release; name = Release;
}; };
@@ -3047,7 +3035,6 @@
SKIP_INSTALL = YES; SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Off; SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = 4; TARGETED_DEVICE_FAMILY = 4;
}; };
name = Debug; name = Debug;
@@ -3071,7 +3058,6 @@
SKIP_INSTALL = YES; SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-O"; SWIFT_OPTIMIZATION_LEVEL = "-O";
SWIFT_SWIFT3_OBJC_INFERENCE = Off; SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = 4; TARGETED_DEVICE_FAMILY = 4;
}; };
name = Release; name = Release;
+3 -6
View File
@@ -303,8 +303,8 @@ final class TransactionTests: BaseTestCase {
do { do {
let createExpectation = self.expectation(description: "create") let createExpectation = self.expectation(description: "create")
let dataPrepared: Void? = try? stack.perform( try stack.perform(
synchronous: { (transaction) in synchronous: { (transaction) -> Void in
let object = transaction.create(Into<TestEntity1>()) let object = transaction.create(Into<TestEntity1>())
object.testEntityID = NSNumber(value: 1) object.testEntityID = NSNumber(value: 1)
@@ -313,10 +313,7 @@ final class TransactionTests: BaseTestCase {
object.testDate = testDate object.testDate = testDate
} }
) )
if dataPrepared != nil { createExpectation.fulfill()
createExpectation.fulfill()
}
self.checkExpectationsImmediately() self.checkExpectationsImmediately()
} }
do { do {
+1 -1
View File
@@ -29,7 +29,7 @@ import CoreData
// MARK: - BaseDataTransaction // MARK: - BaseDataTransaction
public extension BaseDataTransaction { extension BaseDataTransaction {
/** /**
Creates an `ImportableObject` by importing from the specified import source. Creates an `ImportableObject` by importing from the specified import source.
+1 -1
View File
@@ -565,7 +565,7 @@ extension BaseDataTransaction: FetchableSource, QueryableSource {
// MARK: Obsoleted // MARK: Obsoleted
@available(*, obsoleted: 3.1, renamed: "unsafeContext()") @available(swift, obsoleted: 3.1, renamed: "unsafeContext()")
public func internalContext() -> NSManagedObjectContext { public func internalContext() -> NSManagedObjectContext {
fatalError() fatalError()
+1 -1
View File
@@ -29,7 +29,7 @@ import CoreData
// MARK: - CSBaseDataTransaction // MARK: - CSBaseDataTransaction
public extension CSBaseDataTransaction { extension CSBaseDataTransaction {
/** /**
Fetches the `NSManagedObject` instance in the transaction's context from a reference created from a transaction or from a different managed object context. Fetches the `NSManagedObject` instance in the transaction's context from a reference created from a transaction or from a different managed object context.
+1 -1
View File
@@ -29,7 +29,7 @@ import CoreData
// MARK: - CSCoreStore // MARK: - CSCoreStore
public extension CSCoreStore { extension CSCoreStore {
/** /**
Asynchronously adds a `CSInMemoryStore` to the `defaultStack`. Migrations are also initiated by default. Asynchronously adds a `CSInMemoryStore` to the `defaultStack`. Migrations are also initiated by default.
+1 -1
View File
@@ -30,7 +30,7 @@ import CoreData
// MARK: - CSCoreStore // MARK: - CSCoreStore
@available(macOS 10.12, *) @available(macOS 10.12, *)
public extension CSCoreStore { extension CSCoreStore {
/** /**
Using the `defaultStack`, creates an `CSObjectMonitor` for the specified `NSManagedObject`. Multiple `CSObjectObserver`s may then register themselves to be notified when changes are made to the `NSManagedObject`. Using the `defaultStack`, creates an `CSObjectMonitor` for the specified `NSManagedObject`. Multiple `CSObjectObserver`s may then register themselves to be notified when changes are made to the `NSManagedObject`.
+1 -1
View File
@@ -29,7 +29,7 @@ import CoreData
// MARK: - CSCoreStore // MARK: - CSCoreStore
public extension CSCoreStore { extension CSCoreStore {
/** /**
Using the `defaultStack`, fetches the `NSManagedObject` instance in the transaction's context from a reference created from a transaction or from a different managed object context. Using the `defaultStack`, fetches the `NSManagedObject` instance in the transaction's context from a reference created from a transaction or from a different managed object context.
+1 -1
View File
@@ -29,7 +29,7 @@ import CoreData
// MARK: - CSCoreStore // MARK: - CSCoreStore
public extension CSCoreStore { extension CSCoreStore {
/** /**
Returns the `defaultStack`'s model version. The version string is the same as the name of the version-specific .xcdatamodeld file. Returns the `defaultStack`'s model version. The version string is the same as the name of the version-specific .xcdatamodeld file.
+1 -1
View File
@@ -28,7 +28,7 @@ import Foundation
// MARK: - CSCoreStore // MARK: - CSCoreStore
public extension CSCoreStore { extension CSCoreStore {
/** /**
Using the `defaultStack`, begins a transaction asynchronously where `NSManagedObject` creates, updates, and deletes can be made. Using the `defaultStack`, begins a transaction asynchronously where `NSManagedObject` creates, updates, and deletes can be made.
+1 -1
View File
@@ -29,7 +29,7 @@ import CoreData
// MARK: - CSDataStack // MARK: - CSDataStack
public extension CSDataStack { extension CSDataStack {
/** /**
Asynchronously adds a `CSInMemoryStore` to the stack. Migrations are also initiated by default. Asynchronously adds a `CSInMemoryStore` to the stack. Migrations are also initiated by default.
+1 -1
View File
@@ -30,7 +30,7 @@ import CoreData
// MARK: - CSDataStack // MARK: - CSDataStack
@available(macOS 10.12, *) @available(macOS 10.12, *)
public extension CSDataStack { extension CSDataStack {
/** /**
Creates a `CSObjectMonitor` for the specified `NSManagedObject`. Multiple `ObjectObserver`s may then register themselves to be notified when changes are made to the `NSManagedObject`. Creates a `CSObjectMonitor` for the specified `NSManagedObject`. Multiple `ObjectObserver`s may then register themselves to be notified when changes are made to the `NSManagedObject`.
+1 -1
View File
@@ -29,7 +29,7 @@ import CoreData
// MARK: - CSDataStack // MARK: - CSDataStack
public extension CSDataStack { extension CSDataStack {
/** /**
Fetches the `NSManagedObject` instance in the transaction's context from a reference created from a transaction or from a different managed object context. Fetches the `NSManagedObject` instance in the transaction's context from a reference created from a transaction or from a different managed object context.
+1 -1
View File
@@ -28,7 +28,7 @@ import Foundation
// MARK: - CSDataStack // MARK: - CSDataStack
public extension CSDataStack { extension CSDataStack {
/** /**
Begins a transaction asynchronously where `NSManagedObject` creates, updates, and deletes can be made. Begins a transaction asynchronously where `NSManagedObject` creates, updates, and deletes can be made.
+1 -1
View File
@@ -262,7 +262,7 @@ extension CoreStoreError: CoreStoreSwiftType, _ObjectiveCBridgeableError {
// MARK: Internal // MARK: Internal
internal extension Error { extension Error {
internal var bridgeToSwift: CoreStoreError { internal var bridgeToSwift: CoreStoreError {
+2 -2
View File
@@ -195,14 +195,14 @@ public final class CSSQLiteStore: NSObject, CSLocalStorage, CoreStoreObjectiveCT
// MARK: Obsoleted // MARK: Obsoleted
@available(*, obsoleted: 3.1, message: "The `mappingModelBundles` argument of this method is ignored. Use the new -[CSSQLiteStore initWithFileURL:configuration:localStorageOptions:]) initializer instead.") @available(swift, obsoleted: 3.1, message: "The `mappingModelBundles` argument of this method is ignored. Use the new -[CSSQLiteStore initWithFileURL:configuration:localStorageOptions:]) initializer instead.")
@objc @objc
public convenience init(fileURL: URL, configuration: ModelConfiguration, mappingModelBundles: [Bundle]?, localStorageOptions: Int) { public convenience init(fileURL: URL, configuration: ModelConfiguration, mappingModelBundles: [Bundle]?, localStorageOptions: Int) {
fatalError() fatalError()
} }
@available(*, obsoleted: 3.1, message: "The `mappingModelBundles` argument of this method is ignored. Use the new -[CSSQLiteStore initWithFileName:configuration:localStorageOptions:]) initializer instead.") @available(swift, obsoleted: 3.1, message: "The `mappingModelBundles` argument of this method is ignored. Use the new -[CSSQLiteStore initWithFileName:configuration:localStorageOptions:]) initializer instead.")
@objc @objc
public convenience init(fileName: String, configuration: ModelConfiguration, mappingModelBundles: [Bundle]?, localStorageOptions: Int) { public convenience init(fileName: String, configuration: ModelConfiguration, mappingModelBundles: [Bundle]?, localStorageOptions: Int) {
@@ -1111,7 +1111,7 @@ private func createFormattedString(_ firstLine: String, _ lastLine: String, _ in
return string return string
} }
fileprivate extension String { extension String {
fileprivate static func indention(_ level: Int = 1) -> String { fileprivate static func indention(_ level: Int = 1) -> String {
+1 -1
View File
@@ -28,7 +28,7 @@ import Foundation
// MARK: - CoreStore // MARK: - CoreStore
public extension CoreStore { extension CoreStore {
/** /**
The `CoreStoreLogger` instance to be used. The default logger is an instance of a `DefaultLogger`. The `CoreStoreLogger` instance to be used. The default logger is an instance of a `DefaultLogger`.
+1 -1
View File
@@ -29,7 +29,7 @@ import CoreData
// MARK: - CoreStore // MARK: - CoreStore
public extension CoreStore { extension CoreStore {
/** /**
Asynchronously adds a `StorageInterface` to the `defaultStack`. Migrations are also initiated by default. Asynchronously adds a `StorageInterface` to the `defaultStack`. Migrations are also initiated by default.
+1 -1
View File
@@ -30,7 +30,7 @@ import CoreData
// MARK: - CoreStore // MARK: - CoreStore
@available(macOS 10.12, *) @available(macOS 10.12, *)
public extension CoreStore { extension CoreStore {
/** /**
Using the `defaultStack`, creates an `ObjectMonitor` for the specified `DynamicObject`. Multiple `ObjectObserver`s may then register themselves to be notified when changes are made to the `DynamicObject`. Using the `defaultStack`, creates an `ObjectMonitor` for the specified `DynamicObject`. Multiple `ObjectObserver`s may then register themselves to be notified when changes are made to the `DynamicObject`.
+1 -1
View File
@@ -29,7 +29,7 @@ import CoreData
// MARK: - CoreStore // MARK: - CoreStore
public extension CoreStore { extension CoreStore {
/** /**
Using the `defaultStack`, fetches the `DynamicObject` instance in the `DataStack`'s context from a reference created from a transaction or from a different managed object context. Using the `defaultStack`, fetches the `DynamicObject` instance in the `DataStack`'s context from a reference created from a transaction or from a different managed object context.
+2 -2
View File
@@ -29,7 +29,7 @@ import CoreData
// MARK: - CoreStore // MARK: - CoreStore
public extension CoreStore { extension CoreStore {
/** /**
Returns the `defaultStack`'s model version. The version string is the same as the name of a version-specific .xcdatamodeld file or `CoreStoreSchema`. Returns the `defaultStack`'s model version. The version string is the same as the name of a version-specific .xcdatamodeld file or `CoreStoreSchema`.
@@ -152,7 +152,7 @@ public extension CoreStore {
// MARK: Obsolete // MARK: Obsolete
@available(*, obsoleted: 3.1, renamed: "entityDescription(for:)") @available(swift, obsoleted: 3.1, renamed: "entityDescription(for:)")
public static func entityDescriptionForType(_ type: NSManagedObject.Type) -> NSEntityDescription? { public static func entityDescriptionForType(_ type: NSManagedObject.Type) -> NSEntityDescription? {
return self.entityDescription(for: type) return self.entityDescription(for: type)
+1 -1
View File
@@ -28,7 +28,7 @@ import Foundation
// MARK: - CoreStore // MARK: - CoreStore
public extension CoreStore { extension CoreStore {
/** /**
Using the `defaultStack`, performs a transaction asynchronously 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 wrapped as `.success(userInfo: T)` in the `completion`'s `Result<T>`. Any errors thrown from inside the `task` will be reported as `.failure(error: CoreStoreError)`. To cancel/rollback changes, call `try transaction.cancel()`, which throws a `CoreStoreError.userCancelled`. Using the `defaultStack`, performs a transaction asynchronously 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 wrapped as `.success(userInfo: T)` in the `completion`'s `Result<T>`. Any errors thrown from inside the `task` will be reported as `.failure(error: CoreStoreError)`. To cancel/rollback changes, call `try transaction.cancel()`, which throws a `CoreStoreError.userCancelled`.
+1 -1
View File
@@ -332,7 +332,7 @@ public enum CoreStoreErrorCode: Int {
// MARK: - NSError // MARK: - NSError
internal extension NSError { extension NSError {
// MARK: Internal // MARK: Internal
@@ -29,7 +29,7 @@ import CoreData
// MARK: - CoreStoreFetchRequest // MARK: - CoreStoreFetchRequest
internal extension CoreStoreFetchRequest { extension CoreStoreFetchRequest {
// MARK: Internal // MARK: Internal
+1 -1
View File
@@ -29,7 +29,7 @@ import CoreData
// MARK: - CoreStoreObject // MARK: - CoreStoreObject
public extension CoreStoreObject { extension CoreStoreObject {
/** /**
Exposes a `FetchableSource` that can fetch sibling objects of this `CoreStoreObject` instance. This may be the `DataStack`, a `BaseDataTransaction`, the `NSManagedObjectContext` itself, or `nil` if the obejct's parent is already deallocated. Exposes a `FetchableSource` that can fetch sibling objects of this `CoreStoreObject` instance. This may be the `DataStack`, a `BaseDataTransaction`, the `NSManagedObjectContext` itself, or `nil` if the obejct's parent is already deallocated.
+3 -3
View File
@@ -29,7 +29,7 @@ import Foundation
// MARK: - ValueContainer.Required // MARK: - ValueContainer.Required
public extension ValueContainer.Required { extension ValueContainer.Required {
/** /**
Creates a `Where` clause by comparing if a property is equal to a value Creates a `Where` clause by comparing if a property is equal to a value
@@ -112,7 +112,7 @@ public extension ValueContainer.Required {
// MARK: - ValueContainer.Optional // MARK: - ValueContainer.Optional
public extension ValueContainer.Optional { extension ValueContainer.Optional {
/** /**
Creates a `Where` clause by comparing if a property is equal to a value Creates a `Where` clause by comparing if a property is equal to a value
@@ -223,7 +223,7 @@ public extension ValueContainer.Optional {
// MARK: - RelationshipContainer.ToOne // MARK: - RelationshipContainer.ToOne
public extension RelationshipContainer.ToOne { extension RelationshipContainer.ToOne {
/** /**
Creates a `Where` clause by comparing if a property is equal to a value Creates a `Where` clause by comparing if a property is equal to a value
+1 -1
View File
@@ -140,7 +140,7 @@ open /*abstract*/ class CoreStoreObject: DynamicObject, Hashable {
// MARK: - DynamicObject where Self: CoreStoreObject // MARK: - DynamicObject where Self: CoreStoreObject
public extension DynamicObject where Self: CoreStoreObject { extension DynamicObject where Self: CoreStoreObject {
/** /**
Returns the `PartialObject` instance for the object, which acts as a fast, type-safe KVC interface for `CoreStoreObject`. Returns the `PartialObject` instance for the object, which acts as a fast, type-safe KVC interface for `CoreStoreObject`.
+2 -2
View File
@@ -29,7 +29,7 @@ import CoreData
// MARK: - DataStack // MARK: - DataStack
public extension DataStack { extension DataStack {
/** /**
Asynchronously adds a `StorageInterface` to the stack. Migrations are also initiated by default. Asynchronously adds a `StorageInterface` to the stack. Migrations are also initiated by default.
@@ -837,7 +837,7 @@ public extension DataStack {
// MARK: - FilePrivate // MARK: - FilePrivate
fileprivate extension Array where Element == SchemaMappingProvider { extension Array where Element == SchemaMappingProvider {
func findMapping(sourceSchema: DynamicSchema, destinationSchema: DynamicSchema, storage: LocalStorage) throws -> (mappingModel: NSMappingModel, migrationType: MigrationType) { func findMapping(sourceSchema: DynamicSchema, destinationSchema: DynamicSchema, storage: LocalStorage) throws -> (mappingModel: NSMappingModel, migrationType: MigrationType) {
+1 -1
View File
@@ -30,7 +30,7 @@ import CoreData
// MARK: - DataStack // MARK: - DataStack
@available(macOS 10.12, *) @available(macOS 10.12, *)
public extension DataStack { extension DataStack {
/** /**
Creates an `ObjectMonitor` for the specified `DynamicObject`. Multiple `ObjectObserver`s may then register themselves to be notified when changes are made to the `DynamicObject`. Creates an `ObjectMonitor` for the specified `DynamicObject`. Multiple `ObjectObserver`s may then register themselves to be notified when changes are made to the `DynamicObject`.
+1 -1
View File
@@ -511,7 +511,7 @@ extension DataStack: FetchableSource, QueryableSource {
// MARK: Obsoleted // MARK: Obsoleted
@available(*, obsoleted: 3.1, renamed: "unsafeContext()") @available(swift, obsoleted: 3.1, renamed: "unsafeContext()")
public func internalContext() -> NSManagedObjectContext { public func internalContext() -> NSManagedObjectContext {
fatalError() fatalError()
+1 -1
View File
@@ -29,7 +29,7 @@ import CoreData
// MARK: - DataStack // MARK: - DataStack
public extension DataStack { extension DataStack {
/** /**
Performs a transaction asynchronously 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 wrapped as `.success(userInfo: T)` in the `completion`'s `Result<T>`. Any errors thrown from inside the `task` will be reported as `.failure(error: CoreStoreError)`. To cancel/rollback changes, call `try transaction.cancel()`, which throws a `CoreStoreError.userCancelled`. Performs a transaction asynchronously 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 wrapped as `.success(userInfo: T)` in the `completion`'s `Result<T>`. Any errors thrown from inside the `task` will be reported as `.failure(error: CoreStoreError)`. To cancel/rollback changes, call `try transaction.cancel()`, which throws a `CoreStoreError.userCancelled`.
+2 -2
View File
@@ -656,13 +656,13 @@ public final class DataStack: Equatable {
// MARK: Obsolete // MARK: Obsolete
@available(*, obsoleted: 3.1, renamed: "entityDescription(for:)") @available(swift, obsoleted: 3.1, renamed: "entityDescription(for:)")
public func entityDescriptionForType(_ type: NSManagedObject.Type) -> NSEntityDescription? { public func entityDescriptionForType(_ type: NSManagedObject.Type) -> NSEntityDescription? {
return self.entityDescription(for: type) return self.entityDescription(for: type)
} }
@available(*, obsoleted: 3.1, renamed: "objectID(forURIRepresentation:)") @available(swift, obsoleted: 3.1, renamed: "objectID(forURIRepresentation:)")
public func objectIDForURIRepresentation(_ url: URL) -> NSManagedObjectID? { public func objectIDForURIRepresentation(_ url: URL) -> NSManagedObjectID? {
return self.objectID(forURIRepresentation: url) return self.objectID(forURIRepresentation: url)
+1 -1
View File
@@ -28,7 +28,7 @@ import Foundation
// MARK: - DispatchQueue // MARK: - DispatchQueue
internal extension DispatchQueue { extension DispatchQueue {
@nonobjc @inline(__always) @nonobjc @inline(__always)
internal static func serial(_ label: String, qos: DispatchQoS = .default) -> DispatchQueue { internal static func serial(_ label: String, qos: DispatchQoS = .default) -> DispatchQueue {
+1 -1
View File
@@ -58,7 +58,7 @@ public protocol DynamicKeyPath: AnyDynamicKeyPath {
// MARK: - KeyPathString // MARK: - KeyPathString
public extension KeyPathString { extension KeyPathString {
/** /**
Extracts the keyPath string from the property. Extracts the keyPath string from the property.
+1 -1
View File
@@ -29,7 +29,7 @@ import Foundation
// MARK: - DynamicSchema // MARK: - DynamicSchema
public extension DynamicSchema { extension DynamicSchema {
/** /**
Prints the `DynamicSchema` as their corresponding `CoreStoreObject` Swift declarations. This is useful for converting current `XcodeDataModelSchema`-based models into the new `CoreStoreSchema` framework. Additional adjustments may need to be done to the generated source code; for example: `Transformable` concrete types need to be provided, as well as `default` values. Prints the `DynamicSchema` as their corresponding `CoreStoreObject` Swift declarations. This is useful for converting current `XcodeDataModelSchema`-based models into the new `CoreStoreSchema` framework. Additional adjustments may need to be done to the generated source code; for example: `Transformable` concrete types need to be provided, as well as `default` values.
+10 -10
View File
@@ -29,7 +29,7 @@ import CoreData
// MARK: - From // MARK: - From
public extension From { extension From {
/** /**
Creates a `FetchChainBuilder` that starts with the specified `Where` clause Creates a `FetchChainBuilder` that starts with the specified `Where` clause
@@ -240,7 +240,7 @@ public extension From {
// MARK: - From where D: NSManagedObject // MARK: - From where D: NSManagedObject
public extension From where D: NSManagedObject { extension From where D: NSManagedObject {
/** /**
Creates a `QueryChainBuilder` that starts with a `Select` clause created from the specified key path Creates a `QueryChainBuilder` that starts with a `Select` clause created from the specified key path
@@ -283,7 +283,7 @@ public extension From where D: NSManagedObject {
// MARK: - From where D: CoreStoreObject // MARK: - From where D: CoreStoreObject
public extension From where D: CoreStoreObject { extension From where D: CoreStoreObject {
/** /**
Creates a `FetchChainBuilder` that starts with the specified `Where` clause Creates a `FetchChainBuilder` that starts with the specified `Where` clause
@@ -453,7 +453,7 @@ public extension From where D: CoreStoreObject {
// MARK: - FetchChainBuilder // MARK: - FetchChainBuilder
public extension FetchChainBuilder { extension FetchChainBuilder {
/** /**
Adds a `Where` clause to the `FetchChainBuilder` Adds a `Where` clause to the `FetchChainBuilder`
@@ -580,7 +580,7 @@ public extension FetchChainBuilder {
// MARK: - FetchChainBuilder where D: CoreStoreObject // MARK: - FetchChainBuilder where D: CoreStoreObject
public extension FetchChainBuilder where D: CoreStoreObject { extension FetchChainBuilder where D: CoreStoreObject {
public func `where`<T: AnyWhereClause>(_ clause: (D) -> T) -> FetchChainBuilder<D> { public func `where`<T: AnyWhereClause>(_ clause: (D) -> T) -> FetchChainBuilder<D> {
@@ -591,7 +591,7 @@ public extension FetchChainBuilder where D: CoreStoreObject {
// MARK: - QueryChainBuilder // MARK: - QueryChainBuilder
public extension QueryChainBuilder { extension QueryChainBuilder {
/** /**
Adds a `Where` clause to the `QueryChainBuilder` Adds a `Where` clause to the `QueryChainBuilder`
@@ -754,7 +754,7 @@ public extension QueryChainBuilder {
// MARK: - QueryChainBuilder where D: NSManagedObject // MARK: - QueryChainBuilder where D: NSManagedObject
public extension QueryChainBuilder where D: NSManagedObject { extension QueryChainBuilder where D: NSManagedObject {
/** /**
Adds a `GroupBy` clause to the `QueryChainBuilder` Adds a `GroupBy` clause to the `QueryChainBuilder`
@@ -771,7 +771,7 @@ public extension QueryChainBuilder where D: NSManagedObject {
// MARK: - QueryChainBuilder where D: CoreStoreObject // MARK: - QueryChainBuilder where D: CoreStoreObject
public extension QueryChainBuilder where D: CoreStoreObject { extension QueryChainBuilder where D: CoreStoreObject {
/** /**
Adds a `Where` clause to the `QueryChainBuilder` Adds a `Where` clause to the `QueryChainBuilder`
@@ -833,7 +833,7 @@ public extension QueryChainBuilder where D: CoreStoreObject {
// MARK: - SectionMonitorChainBuilder // MARK: - SectionMonitorChainBuilder
@available(macOS 10.12, *) @available(macOS 10.12, *)
public extension SectionMonitorChainBuilder { extension SectionMonitorChainBuilder {
/** /**
Adds a `Where` clause to the `SectionMonitorChainBuilder` Adds a `Where` clause to the `SectionMonitorChainBuilder`
@@ -963,7 +963,7 @@ public extension SectionMonitorChainBuilder {
// MARK: - SectionMonitorChainBuilder where D: CoreStoreObject // MARK: - SectionMonitorChainBuilder where D: CoreStoreObject
@available(macOS 10.12, *) @available(macOS 10.12, *)
public extension SectionMonitorChainBuilder where D: CoreStoreObject { extension SectionMonitorChainBuilder where D: CoreStoreObject {
/** /**
Adds a `Where` clause to the `SectionMonitorChainBuilder` Adds a `Where` clause to the `SectionMonitorChainBuilder`
+2 -2
View File
@@ -103,7 +103,7 @@ public struct GroupBy<D: DynamicObject>: GroupByClause, QueryClause, Hashable {
} }
} }
public extension GroupBy where D: NSManagedObject { extension GroupBy where D: NSManagedObject {
/** /**
Initializes a `GroupBy` clause with a key path Initializes a `GroupBy` clause with a key path
@@ -116,7 +116,7 @@ public extension GroupBy where D: NSManagedObject {
} }
} }
public extension GroupBy where D: CoreStoreObject { extension GroupBy where D: CoreStoreObject {
/** /**
Initializes a `GroupBy` clause with a key path Initializes a `GroupBy` clause with a key path
+1 -1
View File
@@ -554,7 +554,7 @@ public final class ICloudStore: CloudStorage, CustomDebugStringConvertible, Core
// MARK: - Notification Keys // MARK: - Notification Keys
fileprivate extension Notification.Name { extension Notification.Name {
fileprivate static let iCloudUbiquitousStoreWillFinishInitialImport = Notification.Name(rawValue: "iCloudUbiquitousStoreWillFinishInitialImport") fileprivate static let iCloudUbiquitousStoreWillFinishInitialImport = Notification.Name(rawValue: "iCloudUbiquitousStoreWillFinishInitialImport")
fileprivate static let iCloudUbiquitousStoreDidFinishInitialImport = Notification.Name(rawValue: "iCloudUbiquitousStoreDidFinishInitialImport") fileprivate static let iCloudUbiquitousStoreDidFinishInitialImport = Notification.Name(rawValue: "iCloudUbiquitousStoreDidFinishInitialImport")
+6 -6
View File
@@ -80,9 +80,9 @@ public protocol ImportableObject: DynamicObject {
// MARK: - ImportableObject (Default Implementations) // MARK: - ImportableObject (Default Implementations)
public extension ImportableObject { extension ImportableObject {
static func shouldInsert(from source: ImportSource, in transaction: BaseDataTransaction) -> Bool { public static func shouldInsert(from source: ImportSource, in transaction: BaseDataTransaction) -> Bool {
return true return true
} }
@@ -90,14 +90,14 @@ public extension ImportableObject {
// MARK: Obsolete // MARK: Obsolete
@available(*, obsoleted: 3.0.0, renamed: "shouldInsert(from:in:)") @available(swift, obsoleted: 3.0.0, renamed: "shouldInsert(from:in:)")
static func shouldInsertFromImportSource(_ source: ImportSource, inTransaction transaction: BaseDataTransaction) -> Bool { public static func shouldInsertFromImportSource(_ source: ImportSource, inTransaction transaction: BaseDataTransaction) -> Bool {
return Self.shouldInsert(from: source, in: transaction) return Self.shouldInsert(from: source, in: transaction)
} }
@available(*, obsoleted: 3.0.0, renamed: "didInsert(from:in:)") @available(swift, obsoleted: 3.0.0, renamed: "didInsert(from:in:)")
func didInsertFromImportSource(_ source: ImportSource, inTransaction transaction: BaseDataTransaction) throws { public func didInsertFromImportSource(_ source: ImportSource, inTransaction transaction: BaseDataTransaction) throws {
try self.didInsert(from: source, in: transaction) try self.didInsert(from: source, in: transaction)
} }
+20 -17
View File
@@ -116,11 +116,11 @@ public protocol ImportableUniqueObject: ImportableObject {
} }
// MARK: - ImportableUniqueObject (Default Implementations) // MARK: - ImportableUniqueObject where UniqueIDType.QueryableNativeType: CoreDataNativeType
public extension ImportableUniqueObject where UniqueIDType.QueryableNativeType: CoreDataNativeType { extension ImportableUniqueObject where UniqueIDType.QueryableNativeType: CoreDataNativeType {
var uniqueIDValue: UniqueIDType { public var uniqueIDValue: UniqueIDType {
get { get {
@@ -141,19 +141,22 @@ public extension ImportableUniqueObject where UniqueIDType.QueryableNativeType:
} }
} }
public extension ImportableUniqueObject {
static func shouldInsert(from source: ImportSource, in transaction: BaseDataTransaction) -> Bool { // MARK: - ImportableUniqueObject
extension ImportableUniqueObject {
public static func shouldInsert(from source: ImportSource, in transaction: BaseDataTransaction) -> Bool {
return Self.shouldUpdate(from: source, in: transaction) return Self.shouldUpdate(from: source, in: transaction)
} }
static func shouldUpdate(from source: ImportSource, in transaction: BaseDataTransaction) -> Bool{ public static func shouldUpdate(from source: ImportSource, in transaction: BaseDataTransaction) -> Bool{
return true return true
} }
func didInsert(from source: Self.ImportSource, in transaction: BaseDataTransaction) throws { public func didInsert(from source: Self.ImportSource, in transaction: BaseDataTransaction) throws {
try self.update(from: source, in: transaction) try self.update(from: source, in: transaction)
} }
@@ -161,32 +164,32 @@ public extension ImportableUniqueObject {
// MARK: Obsolete // MARK: Obsolete
@available(*, obsoleted: 3.1, renamed: "shouldInsert(from:in:)") @available(swift, obsoleted: 3.1, renamed: "shouldInsert(from:in:)")
static func shouldInsertFromImportSource(_ source: ImportSource, inTransaction transaction: BaseDataTransaction) -> Bool { public static func shouldInsertFromImportSource(_ source: ImportSource, inTransaction transaction: BaseDataTransaction) -> Bool {
return Self.shouldInsert(from: source, in: transaction) return Self.shouldInsert(from: source, in: transaction)
} }
@available(*, obsoleted: 3.1, renamed: "shouldUpdate(from:in:)") @available(swift, obsoleted: 3.1, renamed: "shouldUpdate(from:in:)")
static func shouldUpdateFromImportSource(_ source: ImportSource, inTransaction transaction: BaseDataTransaction) -> Bool { public static func shouldUpdateFromImportSource(_ source: ImportSource, inTransaction transaction: BaseDataTransaction) -> Bool {
return Self.shouldUpdate(from: source, in: transaction) return Self.shouldUpdate(from: source, in: transaction)
} }
@available(*, obsoleted: 3.1, renamed: "uniqueID(from:in:)") @available(swift, obsoleted: 3.1, renamed: "uniqueID(from:in:)")
static func uniqueIDFromImportSource(_ source: ImportSource, inTransaction transaction: BaseDataTransaction) throws -> UniqueIDType? { public static func uniqueIDFromImportSource(_ source: ImportSource, inTransaction transaction: BaseDataTransaction) throws -> UniqueIDType? {
return try Self.uniqueID(from: source, in: transaction) return try Self.uniqueID(from: source, in: transaction)
} }
@available(*, obsoleted: 3.1, renamed: "didInsert(from:in:)") @available(swift, obsoleted: 3.1, renamed: "didInsert(from:in:)")
func didInsertFromImportSource(_ source: ImportSource, inTransaction transaction: BaseDataTransaction) throws { public func didInsertFromImportSource(_ source: ImportSource, inTransaction transaction: BaseDataTransaction) throws {
try self.didInsert(from: source, in: transaction) try self.didInsert(from: source, in: transaction)
} }
@available(*, obsoleted: 3.1, renamed: "update(from:in:)") @available(swift, obsoleted: 3.1, renamed: "update(from:in:)")
func updateFromImportSource(_ source: ImportSource, inTransaction transaction: BaseDataTransaction) throws { public func updateFromImportSource(_ source: ImportSource, inTransaction transaction: BaseDataTransaction) throws {
try self.update(from: source, in: transaction) try self.update(from: source, in: transaction)
} }
+4 -4
View File
@@ -32,22 +32,22 @@ import CoreData
/** /**
A storage interface backed by an SQLite database that was created before CoreStore 2.0.0. A storage interface backed by an SQLite database that was created before CoreStore 2.0.0.
*/ */
@available(*, obsoleted: 3.1, message: "`LegacySQLiteStore` previous users should now use `SQLiteStore`'s new SQLiteStore.legacy(fileName:configuration:migrationMappingProviders:localStorageOptions:) or SQLiteStore.legacy() methods to create an `SQLiteStore` with legacy paths.") @available(swift, obsoleted: 3.1, message: "`LegacySQLiteStore` previous users should now use `SQLiteStore`'s new SQLiteStore.legacy(fileName:configuration:migrationMappingProviders:localStorageOptions:) or SQLiteStore.legacy() methods to create an `SQLiteStore` with legacy paths.")
public final class LegacySQLiteStore: LocalStorage { public final class LegacySQLiteStore: LocalStorage {
@available(*, obsoleted: 3.1, message: "Use `SQLiteStore`'s new SQLiteStore.init(fileURL:configuration:migrationMappingProviders:localStorageOptions:) initializer.") @available(swift, obsoleted: 3.1, message: "Use `SQLiteStore`'s new SQLiteStore.init(fileURL:configuration:migrationMappingProviders:localStorageOptions:) initializer.")
public init(fileURL: URL, configuration: ModelConfiguration = nil, mappingModelBundles: [Bundle] = Bundle.allBundles, localStorageOptions: LocalStorageOptions = nil) { public init(fileURL: URL, configuration: ModelConfiguration = nil, mappingModelBundles: [Bundle] = Bundle.allBundles, localStorageOptions: LocalStorageOptions = nil) {
fatalError() fatalError()
} }
@available(*, obsoleted: 3.1, message: "Use `SQLiteStore`'s new SQLiteStore.legacy(fileName:configuration:migrationMappingProviders:localStorageOptions:) factory method.") @available(swift, obsoleted: 3.1, message: "Use `SQLiteStore`'s new SQLiteStore.legacy(fileName:configuration:migrationMappingProviders:localStorageOptions:) factory method.")
public init(fileName: String, configuration: ModelConfiguration = nil, mappingModelBundles: [Bundle] = Bundle.allBundles, localStorageOptions: LocalStorageOptions = nil) { public init(fileName: String, configuration: ModelConfiguration = nil, mappingModelBundles: [Bundle] = Bundle.allBundles, localStorageOptions: LocalStorageOptions = nil) {
fatalError() fatalError()
} }
@available(*, obsoleted: 3.1, message: "Use `SQLiteStore`'s new SQLiteStore.legacy(...) factory method.") @available(swift, obsoleted: 3.1, message: "Use `SQLiteStore`'s new SQLiteStore.legacy(...) factory method.")
public init() { public init() {
fatalError() fatalError()
+1 -1
View File
@@ -1453,7 +1453,7 @@ extension ListMonitor: FetchedResultsControllerHandler {
// MARK: - Notification Keys // MARK: - Notification Keys
@available(macOS 10.12, *) @available(macOS 10.12, *)
fileprivate extension Notification.Name { extension Notification.Name {
fileprivate static let listMonitorWillChangeList = Notification.Name(rawValue: "listMonitorWillChangeList") fileprivate static let listMonitorWillChangeList = Notification.Name(rawValue: "listMonitorWillChangeList")
fileprivate static let listMonitorDidChangeList = Notification.Name(rawValue: "listMonitorDidChangeList") fileprivate static let listMonitorDidChangeList = Notification.Name(rawValue: "listMonitorDidChangeList")
+3 -3
View File
@@ -83,7 +83,7 @@ public protocol ListObserver: class {
// MARK: - ListObserver (Default Implementations) // MARK: - ListObserver (Default Implementations)
@available(macOS 10.12, *) @available(macOS 10.12, *)
public extension ListObserver { extension ListObserver {
public func listMonitorWillChange(_ monitor: ListMonitor<ListEntityType>) { } public func listMonitorWillChange(_ monitor: ListMonitor<ListEntityType>) { }
@@ -152,7 +152,7 @@ public protocol ListObjectObserver: ListObserver {
// MARK: - ListObjectObserver (Default Implementations) // MARK: - ListObjectObserver (Default Implementations)
@available(macOS 10.12, *) @available(macOS 10.12, *)
public extension ListObjectObserver { extension ListObjectObserver {
public func listMonitor(_ monitor: ListMonitor<ListEntityType>, didInsertObject object: ListEntityType, toIndexPath indexPath: IndexPath) { } public func listMonitor(_ monitor: ListMonitor<ListEntityType>, didInsertObject object: ListEntityType, toIndexPath indexPath: IndexPath) { }
@@ -205,7 +205,7 @@ public protocol ListSectionObserver: ListObjectObserver {
// MARK: - ListSectionObserver (Default Implementations) // MARK: - ListSectionObserver (Default Implementations)
@available(macOS 10.12, *) @available(macOS 10.12, *)
public extension ListSectionObserver { extension ListSectionObserver {
public func listMonitor(_ monitor: ListMonitor<ListEntityType>, didInsertSection sectionInfo: NSFetchedResultsSectionInfo, toSectionIndex sectionIndex: Int) { } public func listMonitor(_ monitor: ListMonitor<ListEntityType>, didInsertSection sectionInfo: NSFetchedResultsSectionInfo, toSectionIndex sectionIndex: Int) { }
@@ -29,7 +29,7 @@ import Foundation
// MARK: - NSEntityDescription // MARK: - NSEntityDescription
internal extension NSEntityDescription { extension NSEntityDescription {
@nonobjc @nonobjc
internal var dynamicObjectType: DynamicObject.Type? { internal var dynamicObjectType: DynamicObject.Type? {
+1 -1
View File
@@ -29,7 +29,7 @@ import Foundation
// MARK: - NSEntityDescription // MARK: - NSEntityDescription
internal extension NSEntityDescription { extension NSEntityDescription {
@nonobjc @nonobjc
internal func cs_resolveAttributeNames() -> [String: (attribute: NSAttributeDescription, versionHash: Data)] { internal func cs_resolveAttributeNames() -> [String: (attribute: NSAttributeDescription, versionHash: Data)] {
@@ -30,7 +30,7 @@ import CoreData
// MARK: - DataStack // MARK: - DataStack
@available(macOS 10.12, *) @available(macOS 10.12, *)
public extension DataStack { extension DataStack {
/** /**
Utility for creating an `NSFetchedResultsController` from the `DataStack`. This is useful when an `NSFetchedResultsController` is preferred over the overhead of `ListMonitor`s abstraction. Utility for creating an `NSFetchedResultsController` from the `DataStack`. This is useful when an `NSFetchedResultsController` is preferred over the overhead of `ListMonitor`s abstraction.
@@ -115,7 +115,7 @@ public extension DataStack {
// MARK: - UnsafeDataTransaction // MARK: - UnsafeDataTransaction
@available(macOS 10.12, *) @available(macOS 10.12, *)
public extension UnsafeDataTransaction { extension UnsafeDataTransaction {
/** /**
Utility for creating an `NSFetchedResultsController` from the `UnsafeDataTransaction`. This is useful when an `NSFetchedResultsController` is preferred over the overhead of `ListMonitor`s abstraction. Utility for creating an `NSFetchedResultsController` from the `UnsafeDataTransaction`. This is useful when an `NSFetchedResultsController` is preferred over the overhead of `ListMonitor`s abstraction.
@@ -30,7 +30,7 @@ import CoreData
// MARK: - CSDataStack // MARK: - CSDataStack
@available(macOS 10.12, *) @available(macOS 10.12, *)
public extension CSDataStack { extension CSDataStack {
@available(*, deprecated, message: "CoreStore will obsolete NSFetchedResultsController support in the future in favor of CSListMonitor") @available(*, deprecated, message: "CoreStore will obsolete NSFetchedResultsController support in the future in favor of CSListMonitor")
@objc @objc
@@ -49,7 +49,7 @@ public extension CSDataStack {
// MARK: - CSUnsafeDataTransaction // MARK: - CSUnsafeDataTransaction
@available(macOS 10.12, *) @available(macOS 10.12, *)
public extension CSUnsafeDataTransaction { extension CSUnsafeDataTransaction {
@available(*, deprecated, message: "CoreStore will obsolete NSFetchedResultsController support in the future in favor of CSListMonitor") @available(*, deprecated, message: "CoreStore will obsolete NSFetchedResultsController support in the future in favor of CSListMonitor")
@objc @objc
+1 -1
View File
@@ -29,7 +29,7 @@ import CoreData
// MARK: - NSManagedObject // MARK: - NSManagedObject
public extension NSManagedObject { extension NSManagedObject {
/** /**
Exposes a `FetchableSource` that can fetch sibling objects of this `NSManagedObject` instance. This may be the `DataStack`, a `BaseDataTransaction`, the `NSManagedObjectContext` itself, or `nil` if the obejct's parent is already deallocated. Exposes a `FetchableSource` that can fetch sibling objects of this `NSManagedObject` instance. This may be the `DataStack`, a `BaseDataTransaction`, the `NSManagedObjectContext` itself, or `nil` if the obejct's parent is already deallocated.
+1 -1
View File
@@ -29,7 +29,7 @@ import CoreData
// MARK: - NSManagedObject // MARK: - NSManagedObject
internal extension NSManagedObject { extension NSManagedObject {
@nonobjc @nonobjc
internal weak var coreStoreObject: CoreStoreObject? { internal weak var coreStoreObject: CoreStoreObject? {
+1 -1
View File
@@ -29,7 +29,7 @@ import CoreData
// MARK: - NSManagedObject // MARK: - NSManagedObject
internal extension NSManagedObject { extension NSManagedObject {
@nonobjc @nonobjc
internal func isRunningInAllowedQueue() -> Bool? { internal func isRunningInAllowedQueue() -> Bool? {
+1 -1
View File
@@ -29,7 +29,7 @@ import CoreData
// MARK: - NSManagedObject // MARK: - NSManagedObject
public extension NSManagedObject { extension NSManagedObject {
/** /**
Provides a convenience wrapper for accessing `-primitiveValueForKey:` with proper calls to `-willAccessValueForKey:` and `-didAccessValueForKey:`. This is useful when implementing accessor methods for transient attributes. Provides a convenience wrapper for accessing `-primitiveValueForKey:` with proper calls to `-willAccessValueForKey:` and `-didAccessValueForKey:`. This is useful when implementing accessor methods for transient attributes.
+1 -1
View File
@@ -29,7 +29,7 @@ import CoreData
// MARK: - NSManagedObject // MARK: - NSManagedObject
public extension NSManagedObject { extension NSManagedObject {
/** /**
Returns this object's parent `UnsafeDataTransaction` instance if it was created from one. Returns `nil` if the parent transaction is either an `AsynchronousDataTransaction` or a `SynchronousDataTransaction`, or if the object is not managed by CoreStore. Returns this object's parent `UnsafeDataTransaction` instance if it was created from one. Returns `nil` if the parent transaction is either an `AsynchronousDataTransaction` or a `SynchronousDataTransaction`, or if the object is not managed by CoreStore.
@@ -29,7 +29,7 @@ import CoreData
// MARK: - NSManagedObjectContext // MARK: - NSManagedObjectContext
internal extension NSManagedObjectContext { extension NSManagedObjectContext {
// MARK: Internal // MARK: Internal
@@ -29,7 +29,7 @@ import CoreData
// MARK: - NSManagedObjectContext // MARK: - NSManagedObjectContext
internal extension NSManagedObjectContext { extension NSManagedObjectContext {
// MARK: Internal // MARK: Internal
@@ -345,7 +345,7 @@ extension NSManagedObjectContext: FetchableSource, QueryableSource {
// MARK: - NSManagedObjectContext (Internal) // MARK: - NSManagedObjectContext (Internal)
internal extension NSManagedObjectContext { extension NSManagedObjectContext {
// MARK: Fetching // MARK: Fetching
+1 -1
View File
@@ -29,7 +29,7 @@ import CoreData
// MARK: - NSManagedObjectContext // MARK: - NSManagedObjectContext
internal extension NSManagedObjectContext { extension NSManagedObjectContext {
// MARK: Internal // MARK: Internal
@@ -29,7 +29,7 @@ import CoreData
// MARK: - NSManagedObjectContext // MARK: - NSManagedObjectContext
internal extension NSManagedObjectContext { extension NSManagedObjectContext {
// MARK: Internal // MARK: Internal
+1 -1
View File
@@ -29,7 +29,7 @@ import Foundation
// MARK: - FilePrivate // MARK: - FilePrivate
internal extension NSManagedObjectModel { extension NSManagedObjectModel {
@nonobjc @nonobjc
internal func cs_resolveNames() -> [String: (entity: NSEntityDescription, versionHash: Data)] { internal func cs_resolveNames() -> [String: (entity: NSEntityDescription, versionHash: Data)] {
+1 -1
View File
@@ -29,7 +29,7 @@ import CoreData
// MARK: - NSPersistentStore // MARK: - NSPersistentStore
internal extension NSPersistentStore { extension NSPersistentStore {
// MARK: Internal // MARK: Internal
@@ -29,7 +29,7 @@ import CoreData
// MARK: - NSPersistentStoreCoordinator // MARK: - NSPersistentStoreCoordinator
internal extension NSPersistentStoreCoordinator { extension NSPersistentStoreCoordinator {
@nonobjc @nonobjc
internal func performAsynchronously(_ closure: @escaping () -> Void) { internal func performAsynchronously(_ closure: @escaping () -> Void) {
+1 -1
View File
@@ -385,7 +385,7 @@ extension ObjectMonitor: FetchedResultsControllerHandler {
// MARK: - Notification.Name // MARK: - Notification.Name
@available(macOS 10.12, *) @available(macOS 10.12, *)
fileprivate extension Notification.Name { extension Notification.Name {
fileprivate static let objectMonitorWillChangeObject = Notification.Name(rawValue: "objectMonitorWillChangeObject") fileprivate static let objectMonitorWillChangeObject = Notification.Name(rawValue: "objectMonitorWillChangeObject")
fileprivate static let objectMonitorDidDeleteObject = Notification.Name(rawValue: "objectMonitorDidDeleteObject") fileprivate static let objectMonitorDidDeleteObject = Notification.Name(rawValue: "objectMonitorDidDeleteObject")
+1 -1
View File
@@ -77,7 +77,7 @@ public protocol ObjectObserver: class {
// MARK: - ObjectObserver (Default Implementations) // MARK: - ObjectObserver (Default Implementations)
@available(macOS 10.12, *) @available(macOS 10.12, *)
public extension ObjectObserver { extension ObjectObserver {
public func objectMonitor(_ monitor: ObjectMonitor<ObjectEntityType>, willUpdateObject object: ObjectEntityType) { } public func objectMonitor(_ monitor: ObjectMonitor<ObjectEntityType>, willUpdateObject object: ObjectEntityType) { }
+5 -2
View File
@@ -257,7 +257,10 @@ public struct OrderBy<D: DynamicObject>: OrderByClause, FetchClause, QueryClause
} }
} }
public extension OrderBy.SortKey where D: CoreStoreObject {
// MARK: - OrderBy.SortKey where D: CoreStoreObject
extension OrderBy.SortKey where D: CoreStoreObject {
/** /**
Indicates that the `KeyPathString` should be sorted in ascending order Indicates that the `KeyPathString` should be sorted in ascending order
@@ -298,7 +301,7 @@ public protocol OrderByClause {
// MARK: - Sequence where Iterator.Element: OrderByClause // MARK: - Sequence where Iterator.Element: OrderByClause
public extension Sequence where Iterator.Element: OrderByClause { extension Sequence where Iterator.Element: OrderByClause {
/** /**
Combines multiple `OrderBy` predicates together Combines multiple `OrderBy` predicates together
+1 -1
View File
@@ -28,7 +28,7 @@ import Foundation
// MARK: - Progress // MARK: - Progress
public extension Progress { extension Progress {
/** /**
Sets a closure that the `Progress` calls whenever its `fractionCompleted` changes. You can use this instead of setting up KVO. Sets a closure that the `Progress` calls whenever its `fractionCompleted` changes. You can use this instead of setting up KVO.
+2 -2
View File
@@ -28,7 +28,7 @@ import Foundation
// MARK: - Progress // MARK: - Progress
public extension Progress { extension Progress {
/** /**
Sets a closure that the `NSProgress` calls whenever its `fractionCompleted` changes. You can use this instead of setting up KVO. Sets a closure that the `NSProgress` calls whenever its `fractionCompleted` changes. You can use this instead of setting up KVO.
@@ -36,7 +36,7 @@ public extension Progress {
- parameter closure: the closure to execute on progress change - parameter closure: the closure to execute on progress change
*/ */
@objc @objc
public func cs_setProgressHandler(_ closure: ((_ progress: Progress) -> Void)?) { dynamic public func cs_setProgressHandler(_ closure: ((_ progress: Progress) -> Void)?) {
self.setProgressHandler(closure) self.setProgressHandler(closure)
} }
+1 -1
View File
@@ -29,7 +29,7 @@ import Foundation
// MARK: - DynamicObject // MARK: - DynamicObject
public extension DynamicObject where Self: CoreStoreObject { extension DynamicObject where Self: CoreStoreObject {
/** /**
The containing type for relationships. `Relationship`s can be any `CoreStoreObject` subclass. The containing type for relationships. `Relationship`s can be any `CoreStoreObject` subclass.
+2 -2
View File
@@ -356,13 +356,13 @@ public final class SQLiteStore: LocalStorage {
// MARK: Obsoleted // MARK: Obsoleted
@available(*, obsoleted: 3.1, message: "The `mappingModelBundles` argument of this method is ignored. Use the new SQLiteStore.init(fileURL:configuration:migrationMappingProviders:localStorageOptions:) initializer instead.") @available(swift, obsoleted: 3.1, message: "The `mappingModelBundles` argument of this method is ignored. Use the new SQLiteStore.init(fileURL:configuration:migrationMappingProviders:localStorageOptions:) initializer instead.")
public convenience init(fileURL: URL, configuration: ModelConfiguration = nil, mappingModelBundles: [Bundle], localStorageOptions: LocalStorageOptions = nil) { public convenience init(fileURL: URL, configuration: ModelConfiguration = nil, mappingModelBundles: [Bundle], localStorageOptions: LocalStorageOptions = nil) {
fatalError() fatalError()
} }
@available(*, obsoleted: 3.1, message: "The `mappingModelBundles` argument of this method is ignored. Use the new SQLiteStore.init(fileName:configuration:migrationMappingProviders:localStorageOptions:) initializer instead.") @available(swift, obsoleted: 3.1, message: "The `mappingModelBundles` argument of this method is ignored. Use the new SQLiteStore.init(fileName:configuration:migrationMappingProviders:localStorageOptions:) initializer instead.")
public convenience init(fileName: String, configuration: ModelConfiguration = nil, mappingModelBundles: [Bundle], localStorageOptions: LocalStorageOptions = nil) { public convenience init(fileName: String, configuration: ModelConfiguration = nil, mappingModelBundles: [Bundle], localStorageOptions: LocalStorageOptions = nil) {
fatalError() fatalError()
+2 -2
View File
@@ -73,7 +73,7 @@ public struct SectionBy<D: DynamicObject> {
} }
@available(macOS 10.12, *) @available(macOS 10.12, *)
public extension SectionBy where D: NSManagedObject { extension SectionBy where D: NSManagedObject {
/** /**
Initializes a `SectionBy` clause with the key path to use to group `ListMonitor` objects into sections Initializes a `SectionBy` clause with the key path to use to group `ListMonitor` objects into sections
@@ -99,7 +99,7 @@ public extension SectionBy where D: NSManagedObject {
} }
@available(macOS 10.12, *) @available(macOS 10.12, *)
public extension SectionBy where D: CoreStoreObject { extension SectionBy where D: CoreStoreObject {
/** /**
Initializes a `SectionBy` clause with the key path to use to group `ListMonitor` objects into sections Initializes a `SectionBy` clause with the key path to use to group `ListMonitor` objects into sections
+4 -4
View File
@@ -808,7 +808,7 @@ public struct Select<D: DynamicObject, T: SelectResultType>: SelectClause, Hasha
} }
} }
public extension Select where T: NSManagedObjectID { extension Select where T: NSManagedObjectID {
/** /**
Initializes a `Select` that queries for `NSManagedObjectID` results Initializes a `Select` that queries for `NSManagedObjectID` results
@@ -819,7 +819,7 @@ public extension Select where T: NSManagedObjectID {
} }
} }
public extension Select where D: NSManagedObject { extension Select where D: NSManagedObject {
/** /**
Initializes a `Select` that queries the value of an attribute pertained by a keyPath Initializes a `Select` that queries the value of an attribute pertained by a keyPath
@@ -831,7 +831,7 @@ public extension Select where D: NSManagedObject {
} }
} }
public extension Select where D: CoreStoreObject, T: ImportableAttributeType { extension Select where D: CoreStoreObject, T: ImportableAttributeType {
/** /**
Initializes a `Select` that queries the value of an attribute pertained by a keyPath Initializes a `Select` that queries the value of an attribute pertained by a keyPath
@@ -852,7 +852,7 @@ public extension Select where D: CoreStoreObject, T: ImportableAttributeType {
} }
} }
public extension Select where D: CoreStoreObject, T: ImportableAttributeType & NSCoding & NSCopying { extension Select where D: CoreStoreObject, T: ImportableAttributeType & NSCoding & NSCopying {
/** /**
Initializes a `Select` that queries the value of an attribute pertained by a keyPath Initializes a `Select` that queries the value of an attribute pertained by a keyPath
+2 -2
View File
@@ -152,7 +152,7 @@ public protocol LocalStorage: StorageInterface {
func cs_eraseStorageAndWait(metadata: [String: Any], soureModelHint: NSManagedObjectModel?) throws func cs_eraseStorageAndWait(metadata: [String: Any], soureModelHint: NSManagedObjectModel?) throws
} }
internal extension LocalStorage { extension LocalStorage {
internal func matchesPersistentStore(_ persistentStore: NSPersistentStore) -> Bool { internal func matchesPersistentStore(_ persistentStore: NSPersistentStore) -> Bool {
@@ -239,7 +239,7 @@ public protocol CloudStorage: StorageInterface {
// MARK: - Internal // MARK: - Internal
internal extension CloudStorage { extension CloudStorage {
internal func matchesPersistentStore(_ persistentStore: NSPersistentStore) -> Bool { internal func matchesPersistentStore(_ persistentStore: NSPersistentStore) -> Bool {
+1 -1
View File
@@ -29,7 +29,7 @@ import Foundation
// MARK: - DynamicObject // MARK: - DynamicObject
public extension DynamicObject where Self: CoreStoreObject { extension DynamicObject where Self: CoreStoreObject {
/** /**
The containing type for transformable properties. `Transformable` properties support types that conforms to `NSCoding & NSCopying`. The containing type for transformable properties. `Transformable` properties support types that conforms to `NSCoding & NSCopying`.
@@ -30,7 +30,7 @@ import CoreData
// MARK: - UnsafeDataTransaction // MARK: - UnsafeDataTransaction
@available(macOS 10.12, *) @available(macOS 10.12, *)
public extension UnsafeDataTransaction { extension UnsafeDataTransaction {
/** /**
Creates a `ObjectMonitor` for the specified `DynamicObject`. Multiple `ObjectObserver`s may then register themselves to be notified when changes are made to the `DynamicObject`. Creates a `ObjectMonitor` for the specified `DynamicObject`. Multiple `ObjectObserver`s may then register themselves to be notified when changes are made to the `DynamicObject`.
+1 -1
View File
@@ -29,7 +29,7 @@ import Foundation
// MARK: - DynamicObject // MARK: - DynamicObject
public extension DynamicObject where Self: CoreStoreObject { extension DynamicObject where Self: CoreStoreObject {
/** /**
The containing type for value propertiess. `Value` properties support any type that conforms to `ImportableAttributeType`. The containing type for value propertiess. `Value` properties support any type that conforms to `ImportableAttributeType`.
+4 -4
View File
@@ -307,7 +307,7 @@ public struct Where<D: DynamicObject>: WhereClauseType, FetchClause, QueryClause
// MARK: - Where where D: NSManagedObject // MARK: - Where where D: NSManagedObject
public extension Where where D: NSManagedObject { extension Where where D: NSManagedObject {
/** /**
Initializes a `Where` clause that compares equality to `nil` Initializes a `Where` clause that compares equality to `nil`
@@ -401,7 +401,7 @@ public extension Where where D: NSManagedObject {
// MARK: - Where where D: CoreStoreObject // MARK: - Where where D: CoreStoreObject
public extension Where where D: CoreStoreObject { extension Where where D: CoreStoreObject {
/** /**
Initializes a `Where` clause that compares equality to `nil` Initializes a `Where` clause that compares equality to `nil`
@@ -527,7 +527,7 @@ public extension Where where D: CoreStoreObject {
// MARK: - Sequence where Iterator.Element: WhereClauseType // MARK: - Sequence where Iterator.Element: WhereClauseType
public extension Sequence where Iterator.Element: WhereClauseType { extension Sequence where Iterator.Element: WhereClauseType {
/** /**
Combines multiple `Where` predicates together using `AND` operator Combines multiple `Where` predicates together using `AND` operator
@@ -549,7 +549,7 @@ public extension Sequence where Iterator.Element: WhereClauseType {
// MARK: - Deprecated // MARK: - Deprecated
public extension Where { extension Where {
@available(*, deprecated, renamed: "&&?") @available(*, deprecated, renamed: "&&?")
public static func && (left: Where<D>, right: Where<D>?) -> Where<D> { public static func && (left: Where<D>, right: Where<D>?) -> Where<D> {
+1 -1
View File
@@ -39,7 +39,7 @@ public protocol WhereClauseType: AnyWhereClause {
associatedtype ObjectType: DynamicObject associatedtype ObjectType: DynamicObject
} }
public extension WhereClauseType { extension WhereClauseType where Self.ObjectType: CoreStoreObject {
/** /**
Combines two `Where` predicates together using `AND` operator. Combines two `Where` predicates together using `AND` operator.