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

# fetch(_:)

Returns an array of typed models that match the criteria of the specified fetch descriptor.

## Declaration

```swift
func fetch<T>(_ descriptor: FetchDescriptor<T>) throws -> [T] where T : PersistentModel
```

## Parameters

- `descriptor`: A fetch descriptor that provides the configuration for the fetch.

## Return Value

Return Value The array of typed models that satisfy the criteria of the fetch descriptor. If no models match the criteria, the array is empty.

## See Also

### Fetching models

- [fetch(_:batchSize:)](swiftdata/modelcontext/fetch(_:batchsize:).md)
- [fetchCount(_:)](swiftdata/modelcontext/fetchcount(_:).md)
- [FetchDescriptor](swiftdata/fetchdescriptor.md)
- [FetchResultsCollection](swiftdata/fetchresultscollection.md)
- [enumerate(_:batchSize:allowEscapingMutations:block:)](swiftdata/modelcontext/enumerate(_:batchsize:allowescapingmutations:block:).md)
- [model(for:)](swiftdata/modelcontext/model(for:).md)
- [registeredModel(for:)](swiftdata/modelcontext/registeredmodel(for:).md)
