XcodeSchemaMappingProvider
public final class XcodeSchemaMappingProvider : Hashable, SchemaMappingProvider
A SchemaMappingProvider
that tries to infer model migration between two DynamicSchema
versions by loading an xcmappingmodel file from the specified Bundle
. Throws CoreStoreError.mappingModelNotFound
if the xcmappingmodel file cannot be found, or if the xcmappingmodel doesn’t resolve the source and destination DynamicSchema
.
-
The source model version for the mapping.
Declaration
Swift
public let sourceVersion: ModelVersion
-
The destination model version for the mapping.
Declaration
Swift
public let destinationVersion: ModelVersion
-
The
Bundle
that contains the xcmappingmodel file.Declaration
Swift
public let mappingModelBundle: Bundle
-
Creates an
XcodeSchemaMappingProvider
Declaration
Swift
public required init(from sourceVersion: ModelVersion, to destinationVersion: ModelVersion, mappingModelBundle: Bundle)
Parameters
sourceVersion
the source model version for the mapping
destinationVersion
the destination model version for the mapping
mappingModelBundle
the
Bundle
that contains the xcmappingmodel file
-
Declaration
Swift
public static func == (lhs: XcodeSchemaMappingProvider, rhs: XcodeSchemaMappingProvider) -> Bool
-
Declaration
Swift
public func hash(into hasher: inout Hasher)
-
Declaration
Swift
public func cs_createMappingModel(from sourceSchema: DynamicSchema, to destinationSchema: DynamicSchema, storage: LocalStorage) throws -> (mappingModel: NSMappingModel, migrationType: MigrationType)