From 41902fee2e4dbee0285da868b3608a34f8fc08c6 Mon Sep 17 00:00:00 2001 From: John Estropia Date: Thu, 31 Jan 2019 16:50:43 +0900 Subject: [PATCH] fix compiler errors --- CoreStore.xcodeproj/project.pbxproj | 14 ------- CoreStoreTests/TransactionTests.swift | 9 ++--- Sources/BaseDataTransaction+Importing.swift | 2 +- Sources/BaseDataTransaction+Querying.swift | 2 +- Sources/CSBaseDataTransaction+Querying.swift | 2 +- Sources/CSCoreStore+Migrating.swift | 2 +- Sources/CSCoreStore+Observing.swift | 2 +- Sources/CSCoreStore+Querying.swift | 2 +- Sources/CSCoreStore+Setup.swift | 2 +- Sources/CSCoreStore+Transaction.swift | 2 +- Sources/CSDataStack+Migrating.swift | 2 +- Sources/CSDataStack+Observing.swift | 2 +- Sources/CSDataStack+Querying.swift | 2 +- Sources/CSDataStack+Transaction.swift | 2 +- Sources/CSError.swift | 2 +- Sources/CSSQliteStore.swift | 4 +- ...reStore+CustomDebugStringConvertible.swift | 2 +- Sources/CoreStore+Logging.swift | 2 +- Sources/CoreStore+Migration.swift | 2 +- Sources/CoreStore+Observing.swift | 2 +- Sources/CoreStore+Querying.swift | 2 +- Sources/CoreStore+Setup.swift | 4 +- Sources/CoreStore+Transaction.swift | 2 +- Sources/CoreStoreError.swift | 2 +- Sources/CoreStoreFetchRequest+CoreStore.swift | 2 +- Sources/CoreStoreObject+Convenience.swift | 2 +- Sources/CoreStoreObject+Querying.swift | 6 +-- Sources/CoreStoreObject.swift | 2 +- Sources/DataStack+Migration.swift | 4 +- Sources/DataStack+Observing.swift | 2 +- Sources/DataStack+Querying.swift | 2 +- Sources/DataStack+Transaction.swift | 2 +- Sources/DataStack.swift | 4 +- Sources/DispatchQueue+CoreStore.swift | 2 +- Sources/DynamicKeyPath.swift | 4 +- Sources/DynamicSchema+Convenience.swift | 2 +- Sources/From+Querying.swift | 20 +++++----- Sources/GroupBy.swift | 4 +- Sources/ICloudStore.swift | 2 +- Sources/ImportableObject.swift | 12 +++--- Sources/ImportableUniqueObject.swift | 37 ++++++++++--------- Sources/LegacySQLiteStore.swift | 8 ++-- Sources/ListMonitor.swift | 2 +- Sources/ListObserver.swift | 6 +-- .../NSEntityDescription+DynamicModel.swift | 2 +- Sources/NSEntityDescription+Migration.swift | 2 +- ...FetchedResultsController+Convenience.swift | 4 +- ...SFetchedResultsController+ObjectiveC.swift | 4 +- Sources/NSManagedObject+Convenience.swift | 2 +- Sources/NSManagedObject+DynamicModel.swift | 2 +- Sources/NSManagedObject+Logging.swift | 2 +- Sources/NSManagedObject+ObjectiveC.swift | 2 +- Sources/NSManagedObject+Transaction.swift | 2 +- .../NSManagedObjectContext+CoreStore.swift | 2 +- .../NSManagedObjectContext+ObjectiveC.swift | 2 +- Sources/NSManagedObjectContext+Querying.swift | 2 +- Sources/NSManagedObjectContext+Setup.swift | 2 +- .../NSManagedObjectContext+Transaction.swift | 2 +- Sources/NSManagedObjectModel+Migration.swift | 2 +- Sources/NSPersistentStore+Setup.swift | 2 +- .../NSPersistentStoreCoordinator+Setup.swift | 2 +- Sources/ObjectMonitor.swift | 2 +- Sources/ObjectObserver.swift | 2 +- Sources/OrderBy.swift | 7 +++- Sources/Progress+Convenience.swift | 2 +- Sources/Progress+ObjectiveC.swift | 4 +- Sources/Relationship.swift | 2 +- Sources/SQLiteStore.swift | 4 +- Sources/SectionBy.swift | 4 +- Sources/Select.swift | 8 ++-- Sources/StorageInterface.swift | 4 +- Sources/Transformable.swift | 2 +- Sources/UnsafeDataTransaction+Observing.swift | 2 +- Sources/Value.swift | 2 +- Sources/Where.swift | 10 ++--- Sources/WhereClauseType.swift | 2 +- 76 files changed, 140 insertions(+), 151 deletions(-) diff --git a/CoreStore.xcodeproj/project.pbxproj b/CoreStore.xcodeproj/project.pbxproj index 9811c98..735bd39 100644 --- a/CoreStore.xcodeproj/project.pbxproj +++ b/CoreStore.xcodeproj/project.pbxproj @@ -2796,7 +2796,6 @@ SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_SWIFT3_OBJC_INFERENCE = Off; - SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -2815,7 +2814,6 @@ SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-O"; SWIFT_SWIFT3_OBJC_INFERENCE = Off; - SWIFT_VERSION = 4.2; }; name = Release; }; @@ -2836,7 +2834,6 @@ SWIFT_OBJC_BRIDGING_HEADER = "CoreStoreTests/CoreStoreTests-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_SWIFT3_OBJC_INFERENCE = Off; - SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -2852,7 +2849,6 @@ SDKROOT = iphoneos; SWIFT_OBJC_BRIDGING_HEADER = "CoreStoreTests/CoreStoreTests-Bridging-Header.h"; SWIFT_SWIFT3_OBJC_INFERENCE = Off; - SWIFT_VERSION = 4.2; }; name = Release; }; @@ -2873,7 +2869,6 @@ SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_SWIFT3_OBJC_INFERENCE = Off; - SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = 3; }; name = Debug; @@ -2895,7 +2890,6 @@ SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-O"; SWIFT_SWIFT3_OBJC_INFERENCE = Off; - SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = 3; }; name = Release; @@ -2914,7 +2908,6 @@ SWIFT_OBJC_BRIDGING_HEADER = "CoreStoreTests/CoreStoreTests-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_SWIFT3_OBJC_INFERENCE = Off; - SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = 3; }; name = Debug; @@ -2933,7 +2926,6 @@ SDKROOT = appletvos; SWIFT_OBJC_BRIDGING_HEADER = "CoreStoreTests/CoreStoreTests-Bridging-Header.h"; SWIFT_SWIFT3_OBJC_INFERENCE = Off; - SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = 3; }; name = Release; @@ -2958,7 +2950,6 @@ SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_SWIFT3_OBJC_INFERENCE = Off; - SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -2983,7 +2974,6 @@ SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-O"; SWIFT_SWIFT3_OBJC_INFERENCE = Off; - SWIFT_VERSION = 4.2; }; name = Release; }; @@ -3004,7 +2994,6 @@ SWIFT_OBJC_BRIDGING_HEADER = "CoreStoreTests/CoreStoreTests-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_SWIFT3_OBJC_INFERENCE = Off; - SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -3025,7 +3014,6 @@ SDKROOT = macosx; SWIFT_OBJC_BRIDGING_HEADER = "CoreStoreTests/CoreStoreTests-Bridging-Header.h"; SWIFT_SWIFT3_OBJC_INFERENCE = Off; - SWIFT_VERSION = 4.2; }; name = Release; }; @@ -3047,7 +3035,6 @@ SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_SWIFT3_OBJC_INFERENCE = Off; - SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = 4; }; name = Debug; @@ -3071,7 +3058,6 @@ SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-O"; SWIFT_SWIFT3_OBJC_INFERENCE = Off; - SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = 4; }; name = Release; diff --git a/CoreStoreTests/TransactionTests.swift b/CoreStoreTests/TransactionTests.swift index a6c4a05..a26e15b 100644 --- a/CoreStoreTests/TransactionTests.swift +++ b/CoreStoreTests/TransactionTests.swift @@ -303,8 +303,8 @@ final class TransactionTests: BaseTestCase { do { let createExpectation = self.expectation(description: "create") - let dataPrepared: Void? = try? stack.perform( - synchronous: { (transaction) in + try stack.perform( + synchronous: { (transaction) -> Void in let object = transaction.create(Into()) object.testEntityID = NSNumber(value: 1) @@ -313,10 +313,7 @@ final class TransactionTests: BaseTestCase { object.testDate = testDate } ) - if dataPrepared != nil { - - createExpectation.fulfill() - } + createExpectation.fulfill() self.checkExpectationsImmediately() } do { diff --git a/Sources/BaseDataTransaction+Importing.swift b/Sources/BaseDataTransaction+Importing.swift index 15ed01c..37b8655 100644 --- a/Sources/BaseDataTransaction+Importing.swift +++ b/Sources/BaseDataTransaction+Importing.swift @@ -29,7 +29,7 @@ import CoreData // MARK: - BaseDataTransaction -public extension BaseDataTransaction { +extension BaseDataTransaction { /** Creates an `ImportableObject` by importing from the specified import source. diff --git a/Sources/BaseDataTransaction+Querying.swift b/Sources/BaseDataTransaction+Querying.swift index 178b8bb..e2a2fb5 100644 --- a/Sources/BaseDataTransaction+Querying.swift +++ b/Sources/BaseDataTransaction+Querying.swift @@ -565,7 +565,7 @@ extension BaseDataTransaction: FetchableSource, QueryableSource { // MARK: Obsoleted - @available(*, obsoleted: 3.1, renamed: "unsafeContext()") + @available(swift, obsoleted: 3.1, renamed: "unsafeContext()") public func internalContext() -> NSManagedObjectContext { fatalError() diff --git a/Sources/CSBaseDataTransaction+Querying.swift b/Sources/CSBaseDataTransaction+Querying.swift index 47ea636..5092d16 100644 --- a/Sources/CSBaseDataTransaction+Querying.swift +++ b/Sources/CSBaseDataTransaction+Querying.swift @@ -29,7 +29,7 @@ import CoreData // 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. diff --git a/Sources/CSCoreStore+Migrating.swift b/Sources/CSCoreStore+Migrating.swift index d8dfd2b..674a284 100644 --- a/Sources/CSCoreStore+Migrating.swift +++ b/Sources/CSCoreStore+Migrating.swift @@ -29,7 +29,7 @@ import CoreData // MARK: - CSCoreStore -public extension CSCoreStore { +extension CSCoreStore { /** Asynchronously adds a `CSInMemoryStore` to the `defaultStack`. Migrations are also initiated by default. diff --git a/Sources/CSCoreStore+Observing.swift b/Sources/CSCoreStore+Observing.swift index 53bf38f..e56b675 100644 --- a/Sources/CSCoreStore+Observing.swift +++ b/Sources/CSCoreStore+Observing.swift @@ -30,7 +30,7 @@ import CoreData // MARK: - CSCoreStore @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`. diff --git a/Sources/CSCoreStore+Querying.swift b/Sources/CSCoreStore+Querying.swift index 03d6d35..a4537e8 100644 --- a/Sources/CSCoreStore+Querying.swift +++ b/Sources/CSCoreStore+Querying.swift @@ -29,7 +29,7 @@ import CoreData // 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. diff --git a/Sources/CSCoreStore+Setup.swift b/Sources/CSCoreStore+Setup.swift index 06cbb3e..148d63b 100644 --- a/Sources/CSCoreStore+Setup.swift +++ b/Sources/CSCoreStore+Setup.swift @@ -29,7 +29,7 @@ import CoreData // 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. diff --git a/Sources/CSCoreStore+Transaction.swift b/Sources/CSCoreStore+Transaction.swift index eeb1137..9dd96dd 100644 --- a/Sources/CSCoreStore+Transaction.swift +++ b/Sources/CSCoreStore+Transaction.swift @@ -28,7 +28,7 @@ import Foundation // MARK: - CSCoreStore -public extension CSCoreStore { +extension CSCoreStore { /** Using the `defaultStack`, begins a transaction asynchronously where `NSManagedObject` creates, updates, and deletes can be made. diff --git a/Sources/CSDataStack+Migrating.swift b/Sources/CSDataStack+Migrating.swift index b00cb0f..0c4e307 100644 --- a/Sources/CSDataStack+Migrating.swift +++ b/Sources/CSDataStack+Migrating.swift @@ -29,7 +29,7 @@ import CoreData // MARK: - CSDataStack -public extension CSDataStack { +extension CSDataStack { /** Asynchronously adds a `CSInMemoryStore` to the stack. Migrations are also initiated by default. diff --git a/Sources/CSDataStack+Observing.swift b/Sources/CSDataStack+Observing.swift index 93c0106..1eda16b 100644 --- a/Sources/CSDataStack+Observing.swift +++ b/Sources/CSDataStack+Observing.swift @@ -30,7 +30,7 @@ import CoreData // MARK: - CSDataStack @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`. diff --git a/Sources/CSDataStack+Querying.swift b/Sources/CSDataStack+Querying.swift index 3e38838..b653ee5 100644 --- a/Sources/CSDataStack+Querying.swift +++ b/Sources/CSDataStack+Querying.swift @@ -29,7 +29,7 @@ import CoreData // 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. diff --git a/Sources/CSDataStack+Transaction.swift b/Sources/CSDataStack+Transaction.swift index 10d800f..baee052 100644 --- a/Sources/CSDataStack+Transaction.swift +++ b/Sources/CSDataStack+Transaction.swift @@ -28,7 +28,7 @@ import Foundation // MARK: - CSDataStack -public extension CSDataStack { +extension CSDataStack { /** Begins a transaction asynchronously where `NSManagedObject` creates, updates, and deletes can be made. diff --git a/Sources/CSError.swift b/Sources/CSError.swift index 84908ff..1420729 100644 --- a/Sources/CSError.swift +++ b/Sources/CSError.swift @@ -262,7 +262,7 @@ extension CoreStoreError: CoreStoreSwiftType, _ObjectiveCBridgeableError { // MARK: Internal -internal extension Error { +extension Error { internal var bridgeToSwift: CoreStoreError { diff --git a/Sources/CSSQliteStore.swift b/Sources/CSSQliteStore.swift index 5e2f6d8..b505558 100644 --- a/Sources/CSSQliteStore.swift +++ b/Sources/CSSQliteStore.swift @@ -195,14 +195,14 @@ public final class CSSQLiteStore: NSObject, CSLocalStorage, CoreStoreObjectiveCT // 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 public convenience init(fileURL: URL, configuration: ModelConfiguration, mappingModelBundles: [Bundle]?, localStorageOptions: Int) { 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 public convenience init(fileName: String, configuration: ModelConfiguration, mappingModelBundles: [Bundle]?, localStorageOptions: Int) { diff --git a/Sources/CoreStore+CustomDebugStringConvertible.swift b/Sources/CoreStore+CustomDebugStringConvertible.swift index 155b9d3..01344ad 100644 --- a/Sources/CoreStore+CustomDebugStringConvertible.swift +++ b/Sources/CoreStore+CustomDebugStringConvertible.swift @@ -1111,7 +1111,7 @@ private func createFormattedString(_ firstLine: String, _ lastLine: String, _ in return string } -fileprivate extension String { +extension String { fileprivate static func indention(_ level: Int = 1) -> String { diff --git a/Sources/CoreStore+Logging.swift b/Sources/CoreStore+Logging.swift index 7f76255..0e13dd9 100644 --- a/Sources/CoreStore+Logging.swift +++ b/Sources/CoreStore+Logging.swift @@ -28,7 +28,7 @@ import Foundation // MARK: - CoreStore -public extension CoreStore { +extension CoreStore { /** The `CoreStoreLogger` instance to be used. The default logger is an instance of a `DefaultLogger`. diff --git a/Sources/CoreStore+Migration.swift b/Sources/CoreStore+Migration.swift index 1a618cb..046ea2f 100644 --- a/Sources/CoreStore+Migration.swift +++ b/Sources/CoreStore+Migration.swift @@ -29,7 +29,7 @@ import CoreData // MARK: - CoreStore -public extension CoreStore { +extension CoreStore { /** Asynchronously adds a `StorageInterface` to the `defaultStack`. Migrations are also initiated by default. diff --git a/Sources/CoreStore+Observing.swift b/Sources/CoreStore+Observing.swift index ca11967..431c98f 100644 --- a/Sources/CoreStore+Observing.swift +++ b/Sources/CoreStore+Observing.swift @@ -30,7 +30,7 @@ import CoreData // MARK: - CoreStore @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`. diff --git a/Sources/CoreStore+Querying.swift b/Sources/CoreStore+Querying.swift index 10983f6..90b928c 100644 --- a/Sources/CoreStore+Querying.swift +++ b/Sources/CoreStore+Querying.swift @@ -29,7 +29,7 @@ import CoreData // 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. diff --git a/Sources/CoreStore+Setup.swift b/Sources/CoreStore+Setup.swift index 2b2b2d3..a0810e8 100644 --- a/Sources/CoreStore+Setup.swift +++ b/Sources/CoreStore+Setup.swift @@ -29,7 +29,7 @@ import CoreData // 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`. @@ -152,7 +152,7 @@ public extension CoreStore { // 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? { return self.entityDescription(for: type) diff --git a/Sources/CoreStore+Transaction.swift b/Sources/CoreStore+Transaction.swift index a037e04..334b9a6 100644 --- a/Sources/CoreStore+Transaction.swift +++ b/Sources/CoreStore+Transaction.swift @@ -28,7 +28,7 @@ import Foundation // 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`. 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`. diff --git a/Sources/CoreStoreError.swift b/Sources/CoreStoreError.swift index 67e09f9..ad19859 100644 --- a/Sources/CoreStoreError.swift +++ b/Sources/CoreStoreError.swift @@ -332,7 +332,7 @@ public enum CoreStoreErrorCode: Int { // MARK: - NSError -internal extension NSError { +extension NSError { // MARK: Internal diff --git a/Sources/CoreStoreFetchRequest+CoreStore.swift b/Sources/CoreStoreFetchRequest+CoreStore.swift index 8a690cf..c607038 100644 --- a/Sources/CoreStoreFetchRequest+CoreStore.swift +++ b/Sources/CoreStoreFetchRequest+CoreStore.swift @@ -29,7 +29,7 @@ import CoreData // MARK: - CoreStoreFetchRequest -internal extension CoreStoreFetchRequest { +extension CoreStoreFetchRequest { // MARK: Internal diff --git a/Sources/CoreStoreObject+Convenience.swift b/Sources/CoreStoreObject+Convenience.swift index cafe1f0..447a310 100644 --- a/Sources/CoreStoreObject+Convenience.swift +++ b/Sources/CoreStoreObject+Convenience.swift @@ -29,7 +29,7 @@ import CoreData // 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. diff --git a/Sources/CoreStoreObject+Querying.swift b/Sources/CoreStoreObject+Querying.swift index 137e871..c3b8ce3 100644 --- a/Sources/CoreStoreObject+Querying.swift +++ b/Sources/CoreStoreObject+Querying.swift @@ -29,7 +29,7 @@ import Foundation // MARK: - ValueContainer.Required -public extension ValueContainer.Required { +extension ValueContainer.Required { /** 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 -public extension ValueContainer.Optional { +extension ValueContainer.Optional { /** 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 -public extension RelationshipContainer.ToOne { +extension RelationshipContainer.ToOne { /** Creates a `Where` clause by comparing if a property is equal to a value diff --git a/Sources/CoreStoreObject.swift b/Sources/CoreStoreObject.swift index 6662c80..eb1dd79 100644 --- a/Sources/CoreStoreObject.swift +++ b/Sources/CoreStoreObject.swift @@ -140,7 +140,7 @@ open /*abstract*/ class CoreStoreObject: DynamicObject, Hashable { // 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`. diff --git a/Sources/DataStack+Migration.swift b/Sources/DataStack+Migration.swift index f22facb..23b8e78 100644 --- a/Sources/DataStack+Migration.swift +++ b/Sources/DataStack+Migration.swift @@ -29,7 +29,7 @@ import CoreData // MARK: - DataStack -public extension DataStack { +extension DataStack { /** Asynchronously adds a `StorageInterface` to the stack. Migrations are also initiated by default. @@ -837,7 +837,7 @@ public extension DataStack { // 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) { diff --git a/Sources/DataStack+Observing.swift b/Sources/DataStack+Observing.swift index 0bffe76..c5a13b3 100644 --- a/Sources/DataStack+Observing.swift +++ b/Sources/DataStack+Observing.swift @@ -30,7 +30,7 @@ import CoreData // MARK: - DataStack @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`. diff --git a/Sources/DataStack+Querying.swift b/Sources/DataStack+Querying.swift index a2ceb35..872007f 100644 --- a/Sources/DataStack+Querying.swift +++ b/Sources/DataStack+Querying.swift @@ -511,7 +511,7 @@ extension DataStack: FetchableSource, QueryableSource { // MARK: Obsoleted - @available(*, obsoleted: 3.1, renamed: "unsafeContext()") + @available(swift, obsoleted: 3.1, renamed: "unsafeContext()") public func internalContext() -> NSManagedObjectContext { fatalError() diff --git a/Sources/DataStack+Transaction.swift b/Sources/DataStack+Transaction.swift index b77c790..aeaba3b 100644 --- a/Sources/DataStack+Transaction.swift +++ b/Sources/DataStack+Transaction.swift @@ -29,7 +29,7 @@ import CoreData // 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`. 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`. diff --git a/Sources/DataStack.swift b/Sources/DataStack.swift index 6188dfe..f1a9566 100644 --- a/Sources/DataStack.swift +++ b/Sources/DataStack.swift @@ -656,13 +656,13 @@ public final class DataStack: Equatable { // MARK: Obsolete - @available(*, obsoleted: 3.1, renamed: "entityDescription(for:)") + @available(swift, obsoleted: 3.1, renamed: "entityDescription(for:)") public func entityDescriptionForType(_ type: NSManagedObject.Type) -> NSEntityDescription? { 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? { return self.objectID(forURIRepresentation: url) diff --git a/Sources/DispatchQueue+CoreStore.swift b/Sources/DispatchQueue+CoreStore.swift index d52a968..2987cbb 100644 --- a/Sources/DispatchQueue+CoreStore.swift +++ b/Sources/DispatchQueue+CoreStore.swift @@ -28,7 +28,7 @@ import Foundation // MARK: - DispatchQueue -internal extension DispatchQueue { +extension DispatchQueue { @nonobjc @inline(__always) internal static func serial(_ label: String, qos: DispatchQoS = .default) -> DispatchQueue { diff --git a/Sources/DynamicKeyPath.swift b/Sources/DynamicKeyPath.swift index 86f3919..a83034d 100644 --- a/Sources/DynamicKeyPath.swift +++ b/Sources/DynamicKeyPath.swift @@ -58,7 +58,7 @@ public protocol DynamicKeyPath: AnyDynamicKeyPath { // MARK: - KeyPathString -public extension KeyPathString { +extension KeyPathString { /** Extracts the keyPath string from the property. @@ -78,7 +78,7 @@ public extension KeyPathString { ``` */ public init(keyPath: KeyPath) { - + self = O.meta[keyPath: keyPath].cs_keyPathString } } diff --git a/Sources/DynamicSchema+Convenience.swift b/Sources/DynamicSchema+Convenience.swift index 24f6f82..f331bfa 100644 --- a/Sources/DynamicSchema+Convenience.swift +++ b/Sources/DynamicSchema+Convenience.swift @@ -29,7 +29,7 @@ import Foundation // 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. diff --git a/Sources/From+Querying.swift b/Sources/From+Querying.swift index 056094e..ad89e3c 100644 --- a/Sources/From+Querying.swift +++ b/Sources/From+Querying.swift @@ -29,7 +29,7 @@ import CoreData // MARK: - From -public extension From { +extension From { /** Creates a `FetchChainBuilder` that starts with the specified `Where` clause @@ -240,7 +240,7 @@ public extension From { // 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 @@ -283,7 +283,7 @@ public extension From where D: NSManagedObject { // 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 @@ -453,7 +453,7 @@ public extension From where D: CoreStoreObject { // MARK: - FetchChainBuilder -public extension FetchChainBuilder { +extension FetchChainBuilder { /** Adds a `Where` clause to the `FetchChainBuilder` @@ -580,7 +580,7 @@ public extension FetchChainBuilder { // MARK: - FetchChainBuilder where D: CoreStoreObject -public extension FetchChainBuilder where D: CoreStoreObject { +extension FetchChainBuilder where D: CoreStoreObject { public func `where`(_ clause: (D) -> T) -> FetchChainBuilder { @@ -591,7 +591,7 @@ public extension FetchChainBuilder where D: CoreStoreObject { // MARK: - QueryChainBuilder -public extension QueryChainBuilder { +extension QueryChainBuilder { /** Adds a `Where` clause to the `QueryChainBuilder` @@ -754,7 +754,7 @@ public extension QueryChainBuilder { // MARK: - QueryChainBuilder where D: NSManagedObject -public extension QueryChainBuilder where D: NSManagedObject { +extension QueryChainBuilder where D: NSManagedObject { /** Adds a `GroupBy` clause to the `QueryChainBuilder` @@ -771,7 +771,7 @@ public extension QueryChainBuilder where D: NSManagedObject { // MARK: - QueryChainBuilder where D: CoreStoreObject -public extension QueryChainBuilder where D: CoreStoreObject { +extension QueryChainBuilder where D: CoreStoreObject { /** Adds a `Where` clause to the `QueryChainBuilder` @@ -833,7 +833,7 @@ public extension QueryChainBuilder where D: CoreStoreObject { // MARK: - SectionMonitorChainBuilder @available(macOS 10.12, *) -public extension SectionMonitorChainBuilder { +extension SectionMonitorChainBuilder { /** Adds a `Where` clause to the `SectionMonitorChainBuilder` @@ -963,7 +963,7 @@ public extension SectionMonitorChainBuilder { // MARK: - SectionMonitorChainBuilder where D: CoreStoreObject @available(macOS 10.12, *) -public extension SectionMonitorChainBuilder where D: CoreStoreObject { +extension SectionMonitorChainBuilder where D: CoreStoreObject { /** Adds a `Where` clause to the `SectionMonitorChainBuilder` diff --git a/Sources/GroupBy.swift b/Sources/GroupBy.swift index 9193080..d1c75fa 100644 --- a/Sources/GroupBy.swift +++ b/Sources/GroupBy.swift @@ -103,7 +103,7 @@ public struct GroupBy: GroupByClause, QueryClause, Hashable { } } -public extension GroupBy where D: NSManagedObject { +extension GroupBy where D: NSManagedObject { /** 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 diff --git a/Sources/ICloudStore.swift b/Sources/ICloudStore.swift index de6bbb4..eeddaaa 100644 --- a/Sources/ICloudStore.swift +++ b/Sources/ICloudStore.swift @@ -554,7 +554,7 @@ public final class ICloudStore: CloudStorage, CustomDebugStringConvertible, Core // MARK: - Notification Keys -fileprivate extension Notification.Name { +extension Notification.Name { fileprivate static let iCloudUbiquitousStoreWillFinishInitialImport = Notification.Name(rawValue: "iCloudUbiquitousStoreWillFinishInitialImport") fileprivate static let iCloudUbiquitousStoreDidFinishInitialImport = Notification.Name(rawValue: "iCloudUbiquitousStoreDidFinishInitialImport") diff --git a/Sources/ImportableObject.swift b/Sources/ImportableObject.swift index 34ccbd3..a3f6718 100644 --- a/Sources/ImportableObject.swift +++ b/Sources/ImportableObject.swift @@ -80,9 +80,9 @@ public protocol ImportableObject: DynamicObject { // 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 } @@ -90,14 +90,14 @@ public extension ImportableObject { // MARK: Obsolete - @available(*, obsoleted: 3.0.0, renamed: "shouldInsert(from:in:)") - static func shouldInsertFromImportSource(_ source: ImportSource, inTransaction transaction: BaseDataTransaction) -> Bool { + @available(swift, obsoleted: 3.0.0, renamed: "shouldInsert(from:in:)") + public static func shouldInsertFromImportSource(_ source: ImportSource, inTransaction transaction: BaseDataTransaction) -> Bool { return Self.shouldInsert(from: source, in: transaction) } - @available(*, obsoleted: 3.0.0, renamed: "didInsert(from:in:)") - func didInsertFromImportSource(_ source: ImportSource, inTransaction transaction: BaseDataTransaction) throws { + @available(swift, obsoleted: 3.0.0, renamed: "didInsert(from:in:)") + public func didInsertFromImportSource(_ source: ImportSource, inTransaction transaction: BaseDataTransaction) throws { try self.didInsert(from: source, in: transaction) } diff --git a/Sources/ImportableUniqueObject.swift b/Sources/ImportableUniqueObject.swift index 0951d95..d55672b 100644 --- a/Sources/ImportableUniqueObject.swift +++ b/Sources/ImportableUniqueObject.swift @@ -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 { @@ -141,19 +141,22 @@ public extension ImportableUniqueObject where UniqueIDType.QueryableNativeType: } } -public extension ImportableUniqueObject { + +// MARK: - ImportableUniqueObject + +extension ImportableUniqueObject { - static func shouldInsert(from source: ImportSource, in transaction: BaseDataTransaction) -> Bool { + public static func shouldInsert(from source: ImportSource, in transaction: BaseDataTransaction) -> Bool { 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 } - 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) } @@ -161,32 +164,32 @@ public extension ImportableUniqueObject { // MARK: Obsolete - @available(*, obsoleted: 3.1, renamed: "shouldInsert(from:in:)") - static func shouldInsertFromImportSource(_ source: ImportSource, inTransaction transaction: BaseDataTransaction) -> Bool { + @available(swift, obsoleted: 3.1, renamed: "shouldInsert(from:in:)") + public static func shouldInsertFromImportSource(_ source: ImportSource, inTransaction transaction: BaseDataTransaction) -> Bool { return Self.shouldInsert(from: source, in: transaction) } - @available(*, obsoleted: 3.1, renamed: "shouldUpdate(from:in:)") - static func shouldUpdateFromImportSource(_ source: ImportSource, inTransaction transaction: BaseDataTransaction) -> Bool { + @available(swift, obsoleted: 3.1, renamed: "shouldUpdate(from:in:)") + public static func shouldUpdateFromImportSource(_ source: ImportSource, inTransaction transaction: BaseDataTransaction) -> Bool { return Self.shouldUpdate(from: source, in: transaction) } - @available(*, obsoleted: 3.1, renamed: "uniqueID(from:in:)") - static func uniqueIDFromImportSource(_ source: ImportSource, inTransaction transaction: BaseDataTransaction) throws -> UniqueIDType? { + @available(swift, obsoleted: 3.1, renamed: "uniqueID(from:in:)") + public static func uniqueIDFromImportSource(_ source: ImportSource, inTransaction transaction: BaseDataTransaction) throws -> UniqueIDType? { return try Self.uniqueID(from: source, in: transaction) } - @available(*, obsoleted: 3.1, renamed: "didInsert(from:in:)") - func didInsertFromImportSource(_ source: ImportSource, inTransaction transaction: BaseDataTransaction) throws { + @available(swift, obsoleted: 3.1, renamed: "didInsert(from:in:)") + public func didInsertFromImportSource(_ source: ImportSource, inTransaction transaction: BaseDataTransaction) throws { try self.didInsert(from: source, in: transaction) } - @available(*, obsoleted: 3.1, renamed: "update(from:in:)") - func updateFromImportSource(_ source: ImportSource, inTransaction transaction: BaseDataTransaction) throws { + @available(swift, obsoleted: 3.1, renamed: "update(from:in:)") + public func updateFromImportSource(_ source: ImportSource, inTransaction transaction: BaseDataTransaction) throws { try self.update(from: source, in: transaction) } diff --git a/Sources/LegacySQLiteStore.swift b/Sources/LegacySQLiteStore.swift index ab7d800..983c704 100644 --- a/Sources/LegacySQLiteStore.swift +++ b/Sources/LegacySQLiteStore.swift @@ -32,22 +32,22 @@ import CoreData /** 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 { - @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) { 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) { 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() { fatalError() diff --git a/Sources/ListMonitor.swift b/Sources/ListMonitor.swift index 05363fe..4278cdf 100644 --- a/Sources/ListMonitor.swift +++ b/Sources/ListMonitor.swift @@ -1453,7 +1453,7 @@ extension ListMonitor: FetchedResultsControllerHandler { // MARK: - Notification Keys @available(macOS 10.12, *) -fileprivate extension Notification.Name { +extension Notification.Name { fileprivate static let listMonitorWillChangeList = Notification.Name(rawValue: "listMonitorWillChangeList") fileprivate static let listMonitorDidChangeList = Notification.Name(rawValue: "listMonitorDidChangeList") diff --git a/Sources/ListObserver.swift b/Sources/ListObserver.swift index 1adf523..b12f543 100644 --- a/Sources/ListObserver.swift +++ b/Sources/ListObserver.swift @@ -83,7 +83,7 @@ public protocol ListObserver: class { // MARK: - ListObserver (Default Implementations) @available(macOS 10.12, *) -public extension ListObserver { +extension ListObserver { public func listMonitorWillChange(_ monitor: ListMonitor) { } @@ -152,7 +152,7 @@ public protocol ListObjectObserver: ListObserver { // MARK: - ListObjectObserver (Default Implementations) @available(macOS 10.12, *) -public extension ListObjectObserver { +extension ListObjectObserver { public func listMonitor(_ monitor: ListMonitor, didInsertObject object: ListEntityType, toIndexPath indexPath: IndexPath) { } @@ -205,7 +205,7 @@ public protocol ListSectionObserver: ListObjectObserver { // MARK: - ListSectionObserver (Default Implementations) @available(macOS 10.12, *) -public extension ListSectionObserver { +extension ListSectionObserver { public func listMonitor(_ monitor: ListMonitor, didInsertSection sectionInfo: NSFetchedResultsSectionInfo, toSectionIndex sectionIndex: Int) { } diff --git a/Sources/NSEntityDescription+DynamicModel.swift b/Sources/NSEntityDescription+DynamicModel.swift index 1f3c518..f025c7b 100644 --- a/Sources/NSEntityDescription+DynamicModel.swift +++ b/Sources/NSEntityDescription+DynamicModel.swift @@ -29,7 +29,7 @@ import Foundation // MARK: - NSEntityDescription -internal extension NSEntityDescription { +extension NSEntityDescription { @nonobjc internal var dynamicObjectType: DynamicObject.Type? { diff --git a/Sources/NSEntityDescription+Migration.swift b/Sources/NSEntityDescription+Migration.swift index ddeb09d..801ce25 100644 --- a/Sources/NSEntityDescription+Migration.swift +++ b/Sources/NSEntityDescription+Migration.swift @@ -29,7 +29,7 @@ import Foundation // MARK: - NSEntityDescription -internal extension NSEntityDescription { +extension NSEntityDescription { @nonobjc internal func cs_resolveAttributeNames() -> [String: (attribute: NSAttributeDescription, versionHash: Data)] { diff --git a/Sources/NSFetchedResultsController+Convenience.swift b/Sources/NSFetchedResultsController+Convenience.swift index 121e001..9d8ad93 100644 --- a/Sources/NSFetchedResultsController+Convenience.swift +++ b/Sources/NSFetchedResultsController+Convenience.swift @@ -30,7 +30,7 @@ import CoreData // MARK: - DataStack @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. @@ -115,7 +115,7 @@ public extension DataStack { // MARK: - UnsafeDataTransaction @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. diff --git a/Sources/NSFetchedResultsController+ObjectiveC.swift b/Sources/NSFetchedResultsController+ObjectiveC.swift index 4bf2ab1..0a47ed4 100644 --- a/Sources/NSFetchedResultsController+ObjectiveC.swift +++ b/Sources/NSFetchedResultsController+ObjectiveC.swift @@ -30,7 +30,7 @@ import CoreData // MARK: - CSDataStack @available(macOS 10.12, *) -public extension CSDataStack { +extension CSDataStack { @available(*, deprecated, message: "CoreStore will obsolete NSFetchedResultsController support in the future in favor of CSListMonitor") @objc @@ -49,7 +49,7 @@ public extension CSDataStack { // MARK: - CSUnsafeDataTransaction @available(macOS 10.12, *) -public extension CSUnsafeDataTransaction { +extension CSUnsafeDataTransaction { @available(*, deprecated, message: "CoreStore will obsolete NSFetchedResultsController support in the future in favor of CSListMonitor") @objc diff --git a/Sources/NSManagedObject+Convenience.swift b/Sources/NSManagedObject+Convenience.swift index 5d8a66b..ae344e3 100644 --- a/Sources/NSManagedObject+Convenience.swift +++ b/Sources/NSManagedObject+Convenience.swift @@ -29,7 +29,7 @@ import CoreData // 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. diff --git a/Sources/NSManagedObject+DynamicModel.swift b/Sources/NSManagedObject+DynamicModel.swift index b2814bb..2aa05fe 100644 --- a/Sources/NSManagedObject+DynamicModel.swift +++ b/Sources/NSManagedObject+DynamicModel.swift @@ -29,7 +29,7 @@ import CoreData // MARK: - NSManagedObject -internal extension NSManagedObject { +extension NSManagedObject { @nonobjc internal weak var coreStoreObject: CoreStoreObject? { diff --git a/Sources/NSManagedObject+Logging.swift b/Sources/NSManagedObject+Logging.swift index b076b0c..bad70a0 100644 --- a/Sources/NSManagedObject+Logging.swift +++ b/Sources/NSManagedObject+Logging.swift @@ -29,7 +29,7 @@ import CoreData // MARK: - NSManagedObject -internal extension NSManagedObject { +extension NSManagedObject { @nonobjc internal func isRunningInAllowedQueue() -> Bool? { diff --git a/Sources/NSManagedObject+ObjectiveC.swift b/Sources/NSManagedObject+ObjectiveC.swift index f30eb3d..9806c78 100644 --- a/Sources/NSManagedObject+ObjectiveC.swift +++ b/Sources/NSManagedObject+ObjectiveC.swift @@ -29,7 +29,7 @@ import CoreData // 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. diff --git a/Sources/NSManagedObject+Transaction.swift b/Sources/NSManagedObject+Transaction.swift index 6d67809..40250f0 100644 --- a/Sources/NSManagedObject+Transaction.swift +++ b/Sources/NSManagedObject+Transaction.swift @@ -29,7 +29,7 @@ import CoreData // 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. diff --git a/Sources/NSManagedObjectContext+CoreStore.swift b/Sources/NSManagedObjectContext+CoreStore.swift index 5ba5d44..dbab567 100644 --- a/Sources/NSManagedObjectContext+CoreStore.swift +++ b/Sources/NSManagedObjectContext+CoreStore.swift @@ -29,7 +29,7 @@ import CoreData // MARK: - NSManagedObjectContext -internal extension NSManagedObjectContext { +extension NSManagedObjectContext { // MARK: Internal diff --git a/Sources/NSManagedObjectContext+ObjectiveC.swift b/Sources/NSManagedObjectContext+ObjectiveC.swift index f0bf381..9a7e72f 100644 --- a/Sources/NSManagedObjectContext+ObjectiveC.swift +++ b/Sources/NSManagedObjectContext+ObjectiveC.swift @@ -29,7 +29,7 @@ import CoreData // MARK: - NSManagedObjectContext -internal extension NSManagedObjectContext { +extension NSManagedObjectContext { // MARK: Internal diff --git a/Sources/NSManagedObjectContext+Querying.swift b/Sources/NSManagedObjectContext+Querying.swift index 05ca270..819536e 100644 --- a/Sources/NSManagedObjectContext+Querying.swift +++ b/Sources/NSManagedObjectContext+Querying.swift @@ -345,7 +345,7 @@ extension NSManagedObjectContext: FetchableSource, QueryableSource { // MARK: - NSManagedObjectContext (Internal) -internal extension NSManagedObjectContext { +extension NSManagedObjectContext { // MARK: Fetching diff --git a/Sources/NSManagedObjectContext+Setup.swift b/Sources/NSManagedObjectContext+Setup.swift index cf51460..130ca0e 100644 --- a/Sources/NSManagedObjectContext+Setup.swift +++ b/Sources/NSManagedObjectContext+Setup.swift @@ -29,7 +29,7 @@ import CoreData // MARK: - NSManagedObjectContext -internal extension NSManagedObjectContext { +extension NSManagedObjectContext { // MARK: Internal diff --git a/Sources/NSManagedObjectContext+Transaction.swift b/Sources/NSManagedObjectContext+Transaction.swift index b3cb3bb..a1a80ff 100644 --- a/Sources/NSManagedObjectContext+Transaction.swift +++ b/Sources/NSManagedObjectContext+Transaction.swift @@ -29,7 +29,7 @@ import CoreData // MARK: - NSManagedObjectContext -internal extension NSManagedObjectContext { +extension NSManagedObjectContext { // MARK: Internal diff --git a/Sources/NSManagedObjectModel+Migration.swift b/Sources/NSManagedObjectModel+Migration.swift index 7bbc0d2..013fd2b 100644 --- a/Sources/NSManagedObjectModel+Migration.swift +++ b/Sources/NSManagedObjectModel+Migration.swift @@ -29,7 +29,7 @@ import Foundation // MARK: - FilePrivate -internal extension NSManagedObjectModel { +extension NSManagedObjectModel { @nonobjc internal func cs_resolveNames() -> [String: (entity: NSEntityDescription, versionHash: Data)] { diff --git a/Sources/NSPersistentStore+Setup.swift b/Sources/NSPersistentStore+Setup.swift index 1ca94a2..de3d5ee 100644 --- a/Sources/NSPersistentStore+Setup.swift +++ b/Sources/NSPersistentStore+Setup.swift @@ -29,7 +29,7 @@ import CoreData // MARK: - NSPersistentStore -internal extension NSPersistentStore { +extension NSPersistentStore { // MARK: Internal diff --git a/Sources/NSPersistentStoreCoordinator+Setup.swift b/Sources/NSPersistentStoreCoordinator+Setup.swift index c26e4c4..eee21f5 100644 --- a/Sources/NSPersistentStoreCoordinator+Setup.swift +++ b/Sources/NSPersistentStoreCoordinator+Setup.swift @@ -29,7 +29,7 @@ import CoreData // MARK: - NSPersistentStoreCoordinator -internal extension NSPersistentStoreCoordinator { +extension NSPersistentStoreCoordinator { @nonobjc internal func performAsynchronously(_ closure: @escaping () -> Void) { diff --git a/Sources/ObjectMonitor.swift b/Sources/ObjectMonitor.swift index 3bfa47e..8d2b8bc 100644 --- a/Sources/ObjectMonitor.swift +++ b/Sources/ObjectMonitor.swift @@ -385,7 +385,7 @@ extension ObjectMonitor: FetchedResultsControllerHandler { // MARK: - Notification.Name @available(macOS 10.12, *) -fileprivate extension Notification.Name { +extension Notification.Name { fileprivate static let objectMonitorWillChangeObject = Notification.Name(rawValue: "objectMonitorWillChangeObject") fileprivate static let objectMonitorDidDeleteObject = Notification.Name(rawValue: "objectMonitorDidDeleteObject") diff --git a/Sources/ObjectObserver.swift b/Sources/ObjectObserver.swift index f3804df..083db14 100644 --- a/Sources/ObjectObserver.swift +++ b/Sources/ObjectObserver.swift @@ -77,7 +77,7 @@ public protocol ObjectObserver: class { // MARK: - ObjectObserver (Default Implementations) @available(macOS 10.12, *) -public extension ObjectObserver { +extension ObjectObserver { public func objectMonitor(_ monitor: ObjectMonitor, willUpdateObject object: ObjectEntityType) { } diff --git a/Sources/OrderBy.swift b/Sources/OrderBy.swift index 5bbee52..cf93ffd 100644 --- a/Sources/OrderBy.swift +++ b/Sources/OrderBy.swift @@ -257,7 +257,10 @@ public struct OrderBy: 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 @@ -298,7 +301,7 @@ public protocol 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 diff --git a/Sources/Progress+Convenience.swift b/Sources/Progress+Convenience.swift index 8cb475f..4dca137 100644 --- a/Sources/Progress+Convenience.swift +++ b/Sources/Progress+Convenience.swift @@ -28,7 +28,7 @@ import Foundation // 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. diff --git a/Sources/Progress+ObjectiveC.swift b/Sources/Progress+ObjectiveC.swift index 1156f1e..e913ff8 100644 --- a/Sources/Progress+ObjectiveC.swift +++ b/Sources/Progress+ObjectiveC.swift @@ -28,7 +28,7 @@ import Foundation // 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. @@ -36,7 +36,7 @@ public extension Progress { - parameter closure: the closure to execute on progress change */ @objc - public func cs_setProgressHandler(_ closure: ((_ progress: Progress) -> Void)?) { + dynamic public func cs_setProgressHandler(_ closure: ((_ progress: Progress) -> Void)?) { self.setProgressHandler(closure) } diff --git a/Sources/Relationship.swift b/Sources/Relationship.swift index b5591fb..ed1c446 100644 --- a/Sources/Relationship.swift +++ b/Sources/Relationship.swift @@ -29,7 +29,7 @@ import Foundation // 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. diff --git a/Sources/SQLiteStore.swift b/Sources/SQLiteStore.swift index eabd563..965b06e 100644 --- a/Sources/SQLiteStore.swift +++ b/Sources/SQLiteStore.swift @@ -356,13 +356,13 @@ public final class SQLiteStore: LocalStorage { // 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) { 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) { fatalError() diff --git a/Sources/SectionBy.swift b/Sources/SectionBy.swift index 02700c8..1c77111 100644 --- a/Sources/SectionBy.swift +++ b/Sources/SectionBy.swift @@ -73,7 +73,7 @@ public struct SectionBy { } @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 @@ -99,7 +99,7 @@ public extension SectionBy where D: NSManagedObject { } @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 diff --git a/Sources/Select.swift b/Sources/Select.swift index 50c1a02..a90579f 100644 --- a/Sources/Select.swift +++ b/Sources/Select.swift @@ -808,7 +808,7 @@ public struct Select: SelectClause, Hasha } } -public extension Select where T: NSManagedObjectID { +extension Select where T: NSManagedObjectID { /** 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 @@ -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 @@ -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 diff --git a/Sources/StorageInterface.swift b/Sources/StorageInterface.swift index 1ba80f1..0fd4482 100644 --- a/Sources/StorageInterface.swift +++ b/Sources/StorageInterface.swift @@ -152,7 +152,7 @@ public protocol LocalStorage: StorageInterface { func cs_eraseStorageAndWait(metadata: [String: Any], soureModelHint: NSManagedObjectModel?) throws } -internal extension LocalStorage { +extension LocalStorage { internal func matchesPersistentStore(_ persistentStore: NSPersistentStore) -> Bool { @@ -239,7 +239,7 @@ public protocol CloudStorage: StorageInterface { // MARK: - Internal -internal extension CloudStorage { +extension CloudStorage { internal func matchesPersistentStore(_ persistentStore: NSPersistentStore) -> Bool { diff --git a/Sources/Transformable.swift b/Sources/Transformable.swift index 6eea86c..7a6317e 100644 --- a/Sources/Transformable.swift +++ b/Sources/Transformable.swift @@ -29,7 +29,7 @@ import Foundation // 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`. diff --git a/Sources/UnsafeDataTransaction+Observing.swift b/Sources/UnsafeDataTransaction+Observing.swift index 3ca12ac..ab38c6b 100644 --- a/Sources/UnsafeDataTransaction+Observing.swift +++ b/Sources/UnsafeDataTransaction+Observing.swift @@ -30,7 +30,7 @@ import CoreData // MARK: - UnsafeDataTransaction @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`. diff --git a/Sources/Value.swift b/Sources/Value.swift index 55a6469..c0e63e6 100644 --- a/Sources/Value.swift +++ b/Sources/Value.swift @@ -29,7 +29,7 @@ import Foundation // 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`. diff --git a/Sources/Where.swift b/Sources/Where.swift index 81df48b..5ddb14d 100644 --- a/Sources/Where.swift +++ b/Sources/Where.swift @@ -45,7 +45,7 @@ public struct Where: WhereClauseType, FetchClause, QueryClause return Where(NSCompoundPredicate(type: .and, subpredicates: [left.predicate, right.predicate])) } - + /** Combines two `Where` predicates together using `OR` operator */ @@ -307,7 +307,7 @@ public struct Where: WhereClauseType, FetchClause, QueryClause // 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` @@ -401,7 +401,7 @@ public extension Where where D: NSManagedObject { // 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` @@ -527,7 +527,7 @@ public extension Where where D: CoreStoreObject { // 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 @@ -549,7 +549,7 @@ public extension Sequence where Iterator.Element: WhereClauseType { // MARK: - Deprecated -public extension Where { +extension Where { @available(*, deprecated, renamed: "&&?") public static func && (left: Where, right: Where?) -> Where { diff --git a/Sources/WhereClauseType.swift b/Sources/WhereClauseType.swift index 8f08721..b55468f 100644 --- a/Sources/WhereClauseType.swift +++ b/Sources/WhereClauseType.swift @@ -39,7 +39,7 @@ public protocol WhereClauseType: AnyWhereClause { associatedtype ObjectType: DynamicObject } -public extension WhereClauseType { +extension WhereClauseType where Self.ObjectType: CoreStoreObject { /** Combines two `Where` predicates together using `AND` operator.