goodbye ObjectiveC

This commit is contained in:
John Estropia
2021-09-22 20:04:58 +09:00
parent bf10f4668c
commit 9a026afe40
110 changed files with 1060 additions and 9816 deletions

View File

@@ -29,29 +29,16 @@ import CoreData
// MARK: - CSStorageInterface
/**
The `CSStorageInterface` serves as the Objective-C bridging type for `StorageInterface`.
- SeeAlso: `StorageInterface`
*/
@available(*, unavailable, message: "CoreStore Objective-C is now obsoleted in preparation for Swift concurrency.")
@objc
public protocol CSStorageInterface {
/**
The string identifier for the `NSPersistentStore`'s `type` property. This is the same string CoreStore will use to create the `NSPersistentStore` from the `NSPersistentStoreCoordinator`'s `addPersistentStoreWithType(...)` method.
*/
@objc
static var storeType: String { get }
/**
The configuration name in the model file
*/
@objc
var configuration: ModelConfiguration { get }
/**
The options dictionary for the `NSPersistentStore`
*/
@objc
var storeOptions: [AnyHashable: Any]? { get }
}
@@ -59,67 +46,32 @@ public protocol CSStorageInterface {
// MARK: - CSLocalStorageOptions
/**
The `CSLocalStorageOptions` provides settings that tells the `CSDataStack` how to setup the persistent store for `CSLocalStorage` implementers.
- SeeAlso: `LocalStorageOptions`
*/
@available(*, unavailable, message: "CoreStore Objective-C is now obsoleted in preparation for Swift concurrency.")
@objc
public enum CSLocalStorageOptions: Int {
/**
Tells the `DataStack` that the store should not be migrated or recreated, and should simply fail on model mismatch
*/
case none = 0
/**
Tells the `DataStack` to delete and recreate the store on model mismatch, otherwise exceptions will be thrown on failure instead
*/
case recreateStoreOnModelMismatch = 1
/**
Tells the `DataStack` to prevent progressive migrations for the store
*/
case preventProgressiveMigration = 2
/**
Tells the `DataStack` to allow lightweight migration for the store when added synchronously
*/
case allowSynchronousLightweightMigration = 4
}
// MARK: - CSLocalStorage
/**
The `CSLocalStorage` serves as the Objective-C bridging type for `LocalStorage`.
- SeeAlso: `LocalStorage`
*/
@available(*, unavailable, message: "CoreStore Objective-C is now obsoleted in preparation for Swift concurrency.")
@objc
public protocol CSLocalStorage: CSStorageInterface {
/**
The `NSURL` that points to the store file
*/
@objc
var fileURL: URL { get }
/**
An array of `SchemaMappingProvider`s that provides the complete mapping models for custom migrations. This is currently only supported for Swift code.
*/
@objc
var migrationMappingProviders: [Any] { get }
/**
Options that tell the `CSDataStack` how to setup the persistent store
*/
@objc
var localStorageOptions: Int { get }
/**
Called by the `CSDataStack` to perform actual deletion of the store file from disk. Do not call directly! The `sourceModel` argument is a hint for the existing store's model version. Implementers can use the `sourceModel` to perform necessary store operations. (SQLite stores for example, can convert WAL journaling mode to DELETE before deleting)
*/
@objc
func cs_eraseStorageAndWait(metadata: NSDictionary, soureModelHint: NSManagedObjectModel?, error: NSErrorPointer) -> Bool
}