mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-03-17 23:14:05 +01:00
Docs update
This commit is contained in:
@@ -33,9 +33,9 @@ import CoreData
|
||||
extension CoreStore {
|
||||
|
||||
/**
|
||||
Asynchronously adds a `StorageInterface` to the `defaultStack`. Migrations are also initiated by default.
|
||||
Asynchronously adds a `StorageInterface` to the `CoreStoreDefaults.dataStack`. Migrations are also initiated by default.
|
||||
```
|
||||
CoreStore.addStorage(
|
||||
dataStack.addStorage(
|
||||
InMemoryStore(configuration: "Config1"),
|
||||
completion: { result in
|
||||
switch result {
|
||||
@@ -50,13 +50,13 @@ extension CoreStore {
|
||||
*/
|
||||
public static func addStorage<T>(_ storage: T, completion: @escaping (SetupResult<T>) -> Void) {
|
||||
|
||||
Shared.defaultStack.addStorage(storage, completion: completion)
|
||||
CoreStoreDefaults.dataStack.addStorage(storage, completion: completion)
|
||||
}
|
||||
|
||||
/**
|
||||
Asynchronously adds a `LocalStorage` to the `defaultStack`. Migrations are also initiated by default.
|
||||
Asynchronously adds a `LocalStorage` to the `CoreStoreDefaults.dataStack`. Migrations are also initiated by default.
|
||||
```
|
||||
let migrationProgress = CoreStore.addStorage(
|
||||
let migrationProgress = dataStack.addStorage(
|
||||
SQLiteStore(fileName: "core_data.sqlite", configuration: "Config1"),
|
||||
completion: { result in
|
||||
switch result {
|
||||
@@ -72,11 +72,11 @@ extension CoreStore {
|
||||
*/
|
||||
public static func addStorage<T: LocalStorage>(_ storage: T, completion: @escaping (SetupResult<T>) -> Void) -> Progress? {
|
||||
|
||||
return Shared.defaultStack.addStorage(storage, completion: completion)
|
||||
return CoreStoreDefaults.dataStack.addStorage(storage, completion: completion)
|
||||
}
|
||||
|
||||
/**
|
||||
Asynchronously adds a `CloudStorage` to the `defaultStack`. Migrations are also initiated by default.
|
||||
Asynchronously adds a `CloudStorage` to the `CoreStoreDefaults.dataStack`. Migrations are also initiated by default.
|
||||
```
|
||||
guard let storage = ICloudStore(
|
||||
ubiquitousContentName: "MyAppCloudData",
|
||||
@@ -104,11 +104,11 @@ extension CoreStore {
|
||||
*/
|
||||
public static func addStorage<T: CloudStorage>(_ storage: T, completion: @escaping (SetupResult<T>) -> Void) {
|
||||
|
||||
Shared.defaultStack.addStorage(storage, completion: completion)
|
||||
CoreStoreDefaults.dataStack.addStorage(storage, completion: completion)
|
||||
}
|
||||
|
||||
/**
|
||||
Migrates a local storage to match the `defaultStack`'s managed object model version. This method does NOT add the migrated store to the data stack.
|
||||
Migrates a local storage to match the `CoreStoreDefaults.dataStack`'s managed object model version. This method does NOT add the migrated store to the data stack.
|
||||
|
||||
- parameter storage: the local storage
|
||||
- parameter completion: the closure to be executed on the main queue when the migration completes, either due to success or failure. The closure's `MigrationResult` argument indicates the result. This closure is NOT executed if an error is thrown, but will be executed with a `.failure` result if an error occurs asynchronously.
|
||||
@@ -117,11 +117,11 @@ extension CoreStore {
|
||||
*/
|
||||
public static func upgradeStorageIfNeeded<T: LocalStorage>(_ storage: T, completion: @escaping (MigrationResult) -> Void) throws -> Progress? {
|
||||
|
||||
return try Shared.defaultStack.upgradeStorageIfNeeded(storage, completion: completion)
|
||||
return try CoreStoreDefaults.dataStack.upgradeStorageIfNeeded(storage, completion: completion)
|
||||
}
|
||||
|
||||
/**
|
||||
Checks the migration steps required for the storage to match the `defaultStack`'s managed object model version.
|
||||
Checks the migration steps required for the storage to match the `CoreStoreDefaults.dataStack`'s managed object model version.
|
||||
|
||||
- parameter storage: the local storage
|
||||
- throws: a `CoreStoreError` value indicating the failure
|
||||
@@ -129,6 +129,6 @@ extension CoreStore {
|
||||
*/
|
||||
public static func requiredMigrationsForStorage<T: LocalStorage>(_ storage: T) throws -> [MigrationType] {
|
||||
|
||||
return try Shared.defaultStack.requiredMigrationsForStorage(storage)
|
||||
return try CoreStoreDefaults.dataStack.requiredMigrationsForStorage(storage)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user