Contents

loadMetadata(of:)

Downloads the metadata for the attachment asynchronously and delivers it as the type you specify.

Declaration

func loadMetadata<MetadataType>(of: MetadataType.Type) async throws -> MetadataType where MetadataType : Decodable, MetadataType : Encodable

Parameters

  • of:

    The type for your attachment’s custom metadata. This type must match the one added with the attachment.

Return Value

The custom metadata object for the attachment.

Discussion

Use this function to retrieve any metadata you included with the attachment. You might use this metadata to retrieve app-specific details that aren’t part of the item’s intrinsic data format.

See Also

Downloading the attachment data