ios – SwiftUI: How to use the fileExporter modifier for multiple file types


I am trying to use SwiftUI’s the .fileExporter modifier with an item that confirms to the Transferable protocol for multiple types like this:

    FileRepresentation(exportedContentType: .pdf) { (item: MyItem) in
        SentTransferredFile(item.webPDFPathURL)
    }

This is how I use the fileExporter:

.fileExporter(isPresented: $exportArchive, item: link, contentTypes: [UTType.webArchive, .pdf]) { 
    ... handle errors etc ...
}

On macOS this gives me a save panel that lets me chose the type and everything works as expected:

enter image description here

However on iOS and iPadOS, I don’t get such an option:

enter image description here

Is this a bug or am I doing something wrong?

Latest articles

spot_imgspot_img

Related articles

Leave a reply

Please enter your comment!
Please enter your name here

spot_imgspot_img