load(_:)
Downloads the attachment data and asynchronously delivers it as the type you specify.
Declaration
func load<AttachmentType>(_ attachmentType: AttachmentType.Type) async throws -> AttachmentType where AttachmentType : TransferableParameters
- attachmentType:
The type you use to interpret the data. An app typically uploads and downloads a single type of data for an activity. For more information about defining your types, see Transferable.
Return Value
A requested type that contains the downloaded information.
Discussion
Use this function to retrieve the file or data another participant provides. The method asynchronously retrieves and decodes the data, returning it as the requested type. If the requested type isn’t available, the method throws an error.