model(for:)
Returns the persistent model for the specified identifier.
Declaration
func model(for persistentModelID: PersistentIdentifier) -> any PersistentModelParameters
- persistentModelID:
The identifier of the model to fetch. For more information, see Persistentidentifier.
Return Value
The identified persistent model, if known to the context; otherwise, an unsaved model with its persistentModelID property set to persistentModelID.