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

# modelContext

The context that serializes any code running on the model actor.

## Declaration

```swift
var modelContext: ModelContext { get }
```

## See Also

### Accessing the container and context

- [modelContainer](swiftdata/modelactor/modelcontainer.md)
