---
title: "metadata(forFormat:)"
framework: avfoundation
role: symbol
role_heading: Instance Method
path: "avfoundation/avcomposition/metadata(forformat:)"
---

# metadata(forFormat:)

Returns an array of metadata items from the container with the specified format.

## Declaration

```swift
func metadata(forFormat format: AVMetadataFormat) -> [AVMetadataItem]
```

## Parameters

- `format`: The metadata format for which you want items.

## Return Value

Return Value An array of AVMetadataItem objects, one for each metadata item in the container of the specified format, or an empty array if there is no metadata for the specified format.

## Discussion

Discussion You can filter the array to the specific items of interest using the class methods provided by AVMetadataItem, like metadataItems(from:filteredByIdentifier:) or metadataItems(from:with:). You can call this method without blocking the current thread after you’ve asynchronously loaded the availableMetadataFormats property.

## See Also

### Accessing metadata

- [metadata](avfoundation/avcomposition/metadata.md)
- [commonMetadata](avfoundation/avcomposition/commonmetadata.md)
- [availableMetadataFormats](avfoundation/avcomposition/availablemetadataformats.md)
- [creationDate](avfoundation/avcomposition/creationdate.md)
- [lyrics](avfoundation/avcomposition/lyrics.md)
