File Export from iOS - eventually import too

iOS 15 - iOS 26.x, SwiftUI, Xcode 26.1.1 (rewritten without links)

I’m attempting to add the capability to export a file from CoreData.

Since ShareLink requires iOS16+, I found an article showing how to create a UIKit wrapper for 'UIActivityViewController' This does work, but I end up with multiple files instead of one. How do I merge this into one file?

Note: I don’t think I want to write to the app’s document directory – rather I’d like to allow the user to export to iCloud. Eventually, I’d like to share a list of dates with descriptions and if someone puts a sensitive date in there – I don’t want it to be left in a directory. I would include a warning that the file that they export needs to be handled with care if there are any sensitive dates. Some might consider birthdays as private information, right?

I'd also like to be able to name the file - so far when the share sheet comes up, I select "Save to Files" and it uses a default name of text.txt

My next step is to be able to import a CSV file (roundtrip) - could you point me to resources for how to do that?

File Export from iOS - eventually import too
 
 
Q