Contents

init(_:schema:isStoredInMemoryOnly:allowsSave:groupContainer:cloudKitDatabase:)

Creates a named model configuration for the specified schema.

Declaration

init(_ name: String? = nil, schema: Schema? = nil, isStoredInMemoryOnly: Bool = false, allowsSave: Bool = true, groupContainer: ModelConfiguration.GroupContainer = .automatic, cloudKitDatabase: ModelConfiguration.CloudKitDatabase = .automatic)

Parameters

  • name:

    An optional name for the model configuration.

  • schema:

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

  • isStoredInMemoryOnly:

    A Boolean value that determines whether the associated persistent storage is ephemeral and exists only in memory. The default value is false.

  • allowsSave:

    A Boolean value that determines whether the associated persistent storage is writable. The default value is true.

  • groupContainer:

    The option to use for detecting the configuration’s group container. For possible values, see Groupcontainer Swift.struct.

  • cloudKitDatabase:

    The option to use for detecting the configuration’s CloudKit database. For possible values, see Cloudkitdatabase Swift.struct.

See Also

Creating a model configuration