I have a ShareLink
working for multiple items just fine, but with one small issue: no matter the type of file I'm sharing, it comes up with x images, even if sharing a recording. The SharePreview
works fine for a single item, but the text part seems to be being ignored for multiple.
The code is as follows for the ShareLink
:
ShareLink(items: selectedRecordings, preview: { _ in
SharePreview("Recording", image: Image("Logo"))
}) {
Image(systemName: "square.and.arrow.up")
.imageScale(.large)
}
And the FileTransferRepresentation
is:
public static var transferRepresentation: some TransferRepresentation {
FileRepresentation(exportedContentType: .wav) { audio in
SentTransferredFile(URL(string: "\(FileHelper.getDocumentsDirectory())\(audio.url)")!)
}
}