---
title: "loadMetadata(for:completionHandler:)"
framework: avfoundation
role: symbol
role_heading: Instance Method
path: "avfoundation/avasset/loadmetadata(for:completionhandler:)"
---

# loadMetadata(for:completionHandler:)

Loads an array of metadata items that the asset contains for the specified format.

## Declaration

```swift
func loadMetadata(for format: AVMetadataFormat, completionHandler: @escaping @Sendable ([AVMetadataItem]?, (any Error)?) -> Void)
```

```swift
func loadMetadata(for format: AVMetadataFormat) async throws -> [AVMetadataItem]
```

## Parameters

- `format`: The format of the metadata items to load.
- `completionHandler`: A callback that the system invokes after it finishes the loading request. It passes the completion handler the following parameters:

## Mentioned in

Retrieving media metadata

## See Also

### Loading metadata

- [metadata](avfoundation/avpartialasyncproperty/metadata-16qej.md)
- [commonMetadata](avfoundation/avpartialasyncproperty/commonmetadata-3j3n4.md)
- [availableMetadataFormats](avfoundation/avpartialasyncproperty/availablemetadataformats-4yiq8.md)
- [creationDate](avfoundation/avpartialasyncproperty/creationdate.md)
- [lyrics](avfoundation/avpartialasyncproperty/lyrics.md)
