loadMetadata(for:completionHandler:)
Loads an array of metadata items that the asset contains for the specified format.
Declaration
func loadMetadata(for format: AVMetadataFormat, completionHandler: @escaping @Sendable ([AVMetadataItem]?, (any Error)?) -> Void)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:
- metadata
An array of metadata items, which may be empty if there are no items of the specified format. The value is
nilif an error occurs.- error
An error object if the request fails; otherwise,
nil.