Contents

init(_:schema:url:allowsSave:cloudKitDatabase:)

Creates a named model configuration that specifies the on-disk location of the schema’s persistent storage.

Declaration

init(_ name: String? = nil, schema: Schema? = nil, url: URL, allowsSave: Bool = true, 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.

  • url:

    The on-disk location of the schema’s persistent storage.

  • allowsSave:

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

  • 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