---
title: "delete(_:)"
framework: swiftdata
role: symbol
role_heading: Instance Method
path: "swiftdata/modelcontext/delete(_:)"
---

# delete(_:)

Removes the specified model from the persistent storage during the next save operation.

## Declaration

```swift
func delete<T>(_ model: T) where T : PersistentModel
```

## Parameters

- `model`: The persistent model to delete.

## Discussion

Discussion When the context nexts commits its changes, SwiftData removes the model from the persistent storage. If the model is new and in an unsaved state, the context simply discards it.

## See Also

### Deleting models

- [deletedModelsArray](swiftdata/modelcontext/deletedmodelsarray.md)
- [delete(model:where:includeSubclasses:)](swiftdata/modelcontext/delete(model:where:includesubclasses:).md)
