---
title: "init(name:)"
framework: coredata
role: symbol
role_heading: Initializer
path: "coredata/nspersistentcontainer/init(name:)"
---

# init(name:)

Creates a container with the specified name.

## Declaration

```swift
convenience init(name: String)
```

## Parameters

- `name`: The name of the doc://com.apple.coredata/documentation/CoreData/NSPersistentContainer object.

## Return Value

Return Value A persistent container initialized with the given name.

## Discussion

Discussion By default, the provided name value is used to name the persistent store and is used to look up the name of the NSManagedObjectModel object to be used with the NSPersistentContainer object.

## See Also

### Creating a Container

- [init(name:managedObjectModel:)](coredata/nspersistentcontainer/init(name:managedobjectmodel:).md)
