Type Aliases
The following type aliases are available globally.
-
A
String
that pertains to the name of an *.xcdatamodeld file (without the file extension).Declaration
Swift
public typealias XcodeDataModelFileName = String
-
An
Optional<String>
that pertains to the name of a “Configuration” which particular groups of entities may belong to. Whennil
, pertains to the default configuration which includes all entities.Declaration
Swift
public typealias ModelConfiguration = String?
-
An
String
that pertains to the name of a versioned *.xcdatamodeld file (without the file extension). Model version strings don’t necessarily have to be numeric or ordered in any way. The migration sequence will always be decided by (or the lack of) theMigrationChain
.Declaration
Swift
public typealias ModelVersion = String
-
An
String
that pertains to an Entity name.Declaration
Swift
public typealias EntityName = String
-
An
String
that pertains to a dynamically-accessable class name (usable with NSClassFromString(…)).Declaration
Swift
public typealias ClassName = String
-
An
String
that pertains to a attribute keyPaths.Declaration
Swift
public typealias KeyPathString = String
-
The
MigrationResult
indicates the result of a migration.MigrationResult.success
indicates either the migration succeeded, or there were no migrations needed. The associated value is an array ofMigrationType
s reflecting the migration steps completed.MigrationResult.failure
indicates that the migration failed. The associated object for this value is the aCoreStoreError
enum value.dataStack.upgradeStorageIfNeeded(SQLiteStorage(fileName: "data.sqlite")) { (result) in switch result { case .success(let migrationSteps): // ... case .failure(let error): // ... } }
Declaration
Swift
public typealias MigrationResult = Swift.Result<[MigrationType], CoreStoreError>
-
The
SetupResult
indicates the result of an asynchronous initialization of a persistent store.SetupResult.success
indicates that the storage setup succeeded. The associated object for thisenum
value is the relatedStorageInterface
instance.SetupResult.failure
indicates that the storage setup failed. The associated object for this value is the relatedCoreStoreError
enum value.try! dataStack.addStorage( SQLiteStore(), completion: { (result: SetupResult) -> Void in switch result { case .success(let storage): // storage is the related StorageInterface instance case .failure(let error): // error is the CoreStoreError enum value for the failure } } )
Declaration
Swift
public typealias SetupResult<StorageInterfaceType> = Swift.Result<StorageInterfaceType, CoreStoreError> where StorageInterfaceType : StorageInterface