---
title: ModelActor()
framework: swiftdata
role: symbol
role_heading: Macro
path: swiftdata/modelactor()
---

# ModelActor()

Converts a Swift actor into a model actor by generating boilerplate code that fulfills the requirements of the associated protocol.

## Declaration

```swift
@attached(member, names: named(modelExecutor), named(modelContainer), named(init)) @attached(extension, conformances: ModelActor) macro ModelActor()
```

## See Also

### Model actors

- [ModelActor](swiftdata/modelactor.md)
