# 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`.

- `sourceVersion`

  The source model version for the mapping.

  #### Declaration

  Swift

      public let sourceVersion: ModelVersion

- `destinationVersion`

  The destination model version for the mapping.

  #### Declaration

  Swift

      public let destinationVersion: ModelVersion

- `mappingModelBundle`

  The `Bundle` that contains the xcmappingmodel file.

  #### Declaration

  Swift

      public let mappingModelBundle: Bundle

- `init(from:to:mappingModelBundle:)`

  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

### Equatable

- `==(_:_:)`

  #### Declaration

  Swift

      public static func == (lhs: XcodeSchemaMappingProvider, rhs: XcodeSchemaMappingProvider) -> Bool

### Hashable

- `hash(into:)`

  #### Declaration

  Swift

      public func hash(into hasher: inout Hasher)

### SchemaMappingProvider

- `cs_createMappingModel(from:to:storage:)`

  #### Declaration

  Swift

      public func cs_createMappingModel(from sourceSchema: DynamicSchema, to destinationSchema: DynamicSchema, storage: LocalStorage) throws -> (mappingModel: NSMappingModel, migrationType: MigrationType)