---
title: "registeredModel(for:)"
framework: swiftdata
role: symbol
role_heading: Instance Method
path: "swiftdata/modelcontext/registeredmodel(for:)"
---

# registeredModel(for:)

Returns the typed model for the specified identifier.

## Declaration

```swift
func registeredModel<T>(for persistentModelID: PersistentIdentifier) -> T? where T : PersistentModel
```

## Parameters

- `persistentModelID`: The identifier of the model to fetch. For more information, see doc://com.apple.SwiftData/documentation/SwiftData/PersistentIdentifier.

## Return Value

Return Value A typed instance of the identified model, if known to the context; otherwise, nil.

## See Also

### Fetching models

- [fetch(_:)](swiftdata/modelcontext/fetch(_:).md)
- [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)
