Initializer

init(name:managedObjectModel:)

Initializes a persistent container with the given name and model.

Declaration

init(name: String, managedObjectModel model: NSManagedObjectModel)

Parameters

name

The name used by the persistent container.

model

The managed object model to be used by the persistent container.

Return Value

A persistent container initialized with the given name and model.

Discussion

By default, the provided name value of the container is used as the name of the persisent store associated with the container. Passing in the NSManagedObjectModel object overrides the lookup of the model by the provided name value.

See Also

Creating a Container

init(name: String)

Initializes a persistent container with the given name.