---
title: "composition(withIdentifier:)"
framework: quartz
role: symbol
role_heading: Instance Method
path: "quartz/qccompositionrepository/composition(withidentifier:)"
---

# composition(withIdentifier:)

Returns the composition that corresponds to the identifier.

## Declaration

```swift
func composition(withIdentifier identifier: String!) -> QCComposition!
```

## Parameters

- `identifier`: A string that uniquely identifies the composition to retrieve.

## Return Value

Return Value The composition identified by the provided string, or nil if there is no composition with that identifier in the composition repository.

## See Also

### Fetching Compositions

- [compositions(withProtocols:andAttributes:)](quartz/qccompositionrepository/compositions(withprotocols:andattributes:).md)
- [allCompositions()](quartz/qccompositionrepository/allcompositions().md)
