---
title: container
framework: swiftdata
role: symbol
role_heading: Instance Property
path: swiftdata/modelcontext/container
---

# container

The context’s model container.

## Declaration

```swift
var container: ModelContainer { get }
```

## Discussion

Discussion The property provides a reference to the model container you specify when calling the context’s initializer. For more information, see init(_:).
