Contents

init(for:migrationPlan:configurations:)

Creates a model container using the specified schema, migration plan, and zero or more configurations.

Declaration

convenience init(for givenSchema: Schema, migrationPlan: (any SchemaMigrationPlan.Type)? = nil, configurations: ModelConfiguration...) throws

Parameters

  • givenSchema:

    A schema that maps your app’s model classes to the associated data in the app’s persistent storage. For more information, see Schema.

  • migrationPlan:

    A plan that describes the evolution of your app’s schema and how the container migrates between specific versions. For more information, see Schemamigrationplan.

  • configurations:

    A list of configurations that describe how the container manages the persisted data for specific groups of models. For more information, see Modelconfiguration.

Discussion

See Also

Creating a model container